garden

ag 2020-04-09T22:19:53.001100Z

can someone help me to write this one in Garden:

.links a:not(:first-child)

noprompt 2020-04-09T22:22:54.001700Z

(require '[garden.selectors :as $])

[:.links ($/a ($/not $/first-child)) ,,,] 

noprompt 2020-04-09T22:25:34.002400Z

Keep in mind you can always write selectors with strings.

noprompt 2020-04-09T22:26:11.003Z

[".links" "a:not(:first-child)" ,,,]

noprompt 2020-04-09T22:26:36.003800Z

You can use the stuff in the garden.selectors too.

ag 2020-04-09T22:27:35.004900Z

oh… cool. I gotta say: so many times I wanted to try Garden, but for various reasons I couldn’t do it at work. Finally for my personal project I picked it up and I was almost immediately amazed how awesome it is.

noprompt 2020-04-09T22:28:27.006100Z

I’m glad you enjoy it. I’ve been lagging on making the next version available because I’ve been busy working on #meander.

noprompt 2020-04-09T22:29:33.007900Z

Its nice to hear folks still find the current version useful enough.

ag 2020-04-09T22:29:40.008100Z

Since you already here, can you tell me how to do something with repeated properties, something like this:

background: #FFFDF2; /* Old browsers */
  background: -moz-linear-gradient(left,  #FFFDF2 0%, #FFFDF2 37%, #ffffff 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,#FFFDF2), color-stop(37%,#FFFDF2), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(left,  #FFFDF2 0%,#FFFDF2 37%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(left,  #FFFDF2 0%,#FFFDF2 37%,#ffffff 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(left,  #FFFDF2 0%,#FFFDF2 37%,#ffffff 100%); /* IE10+ */
  background: linear-gradient(to right,  #FFFDF2 0%,#FFFDF2 37%,#ffffff 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFDF2', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */
I figured out how to do linear-gradients, but not sure how to do something like this

noprompt 2020-04-09T22:29:43.008300Z

I’ve had a ton of fun with it.

noprompt 2020-04-09T22:30:05.008900Z

For repeated properties you just use more maps.

ag 2020-04-09T22:30:49.010600Z

Absolutely. It’s so nice to have a real turing-complete awesome language instead of a pre-processor. I’m just having so much fun. Thank you for this awesomeness.

noprompt 2020-04-09T22:30:50.010700Z

[some-selector
  {:background background1}
  {:background background2} ,,,]

ag 2020-04-09T22:31:02.011100Z

Awesome! Thank you!

noprompt 2020-04-09T22:32:04.012300Z

The dream I had for the next version of garden was to be able to also consume and manipulate existing CSS style sheets in a uniform way.

noprompt 2020-04-09T22:32:34.013300Z

So the “syntax” we have now would just be converted to a common CSS AST.

noprompt 2020-04-09T22:32:46.013700Z

Then you just manipulate the AST.

noprompt 2020-04-09T22:33:23.014700Z

This would basically give you the same power as PostCSS but, you know, with Clojure instead of JavaScript.

ag 2020-04-09T22:33:56.015300Z

That would be absolutely dope. One of the reasons (if I remember it right) why we couldn’t use Garden - because of the existing sass mixins we were forced to use

noprompt 2020-04-09T22:34:27.015800Z

Yeah. I’ve heard (and respect) that rationale over the years.

noprompt 2020-04-09T22:35:16.016700Z

This was more or less one of the things that pushed me toward working on #meander.

noprompt 2020-04-09T22:36:31.017800Z

It’d be nice to have a common AST format in Clojure.

noprompt 2020-04-09T22:37:51.019300Z

I’ve gotta step away now. If you have more questions, ask here, etc. Myself or someone will help.

noprompt 2020-04-09T22:38:09.020Z

I just noticed your question in #css, sorry for not replying there!

ag 2020-04-09T22:38:14.020100Z

I love Meander, although haven’t used it much.

ag 2020-04-09T22:39:05.021400Z

> I just noticed your question in #css, sorry for not replying there! no worries. it wasn’t blocking me. but the :not selector was. Thank you again

noprompt 2020-04-09T22:40:27.022700Z

In the summer time there’ll be a new release of Meander that addresses many of the current limitations. It’ll have aggregation super powers, the ability to query/parse strings and byte streams using pattern matching. I’m really excited about it.

👀 1
ag 2020-04-09T22:41:46.024Z

oh wow.

noprompt 2020-04-09T22:42:06.024500Z

With it, anyone could build something like Garden very quickly.

noprompt 2020-04-09T22:42:31.024900Z

We have an example of how to compile Hiccup but its not as clean as I would like.

noprompt 2020-04-09T22:43:30.025400Z

OK, now I need to step away for real. 😛

ag 2020-04-09T23:14:19.025800Z

Sorry I got a phone call. Thank you again for your help!

👍 1