garden
garden copied to clipboard
make at-media and similar helpers evaluated later
Now when you use at-media
in the middle of garden data structure - it starts eager evaluation, so we are loosing data nature of result. It would be cool to make it lazy:
[:body {}
[at-media {} & rules] ;; (not (at-media)
[:h3 {:line-height [px 5]}]] ;; (not (px 5))
and evaluate lately in (css)
@niquola I'm in agreement. Laziness would be cool. However, I think there is a broader problem (which I've eluded to previously) in that Garden itself doesn't have a data format that's granular enough to represent this sort of thing without the record format it currently uses. Personally, I would rather have an underlying data format that is closer to a parse tree. This would enable the library to be far more flexible.
[:css/rule
[:css/selector "body"]
[:css/at-media
[:css/block
[:css/rule
[:css/selector "h3"]
[:css/block
[:css/declaration
[:css/property "line-height"]
[:css/value
[:css/comma-separated-list
[:css/unit
[:css/number 5]
[:css/measurement "px"]]]]]]]]]]
:+1: