can someone help me to write this one in Garden:
.links a:not(:first-child)
(require '[garden.selectors :as $])
[:.links ($/a ($/not $/first-child)) ,,,]
Keep in mind you can always write selectors with strings.
[".links" "a:not(:first-child)" ,,,]
You can use the stuff in the garden.selectors
too.
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.
I’m glad you enjoy it. I’ve been lagging on making the next version available because I’ve been busy working on #meander.
Its nice to hear folks still find the current version useful enough.
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 thisI’ve had a ton of fun with it.
For repeated properties you just use more maps.
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.
[some-selector
{:background background1}
{:background background2} ,,,]
Awesome! Thank you!
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.
So the “syntax” we have now would just be converted to a common CSS AST.
Then you just manipulate the AST.
This would basically give you the same power as PostCSS but, you know, with Clojure instead of JavaScript.
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
Yeah. I’ve heard (and respect) that rationale over the years.
This was more or less one of the things that pushed me toward working on #meander.
It’d be nice to have a common AST format in Clojure.
I’ve gotta step away now. If you have more questions, ask here, etc. Myself or someone will help.
I just noticed your question in #css, sorry for not replying there!
I love Meander, although haven’t used it much.
> 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
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.
oh wow.
With it, anyone could build something like Garden very quickly.
We have an example of how to compile Hiccup but its not as clean as I would like.
OK, now I need to step away for real. 😛
Sorry I got a phone call. Thank you again for your help!