garden
garden copied to clipboard
Support for feature queries?
Hi
I'm working with my own CSS library named stylefy which uses Garden to convert Clojure style maps to CSS at runtime. The only missing piece is to add support for CSS feature queries (@supports). To my understanding, Garden does not support feature queries at all. Are you planning to add it at some point?
If the support for feature queries is not coming, I can probably handle the situation on my own by converting feature queries to CSS without the help of Garden. However, since I'm already using Garden's "syntax" for defining media query selectors in stylefy, I would like keep these two libraries consistent.
EDIT: I implemented feature query support for stylefy, statements are simply strings. If Garden adds support for @supports using maps, I will add support for it as an alternative way to write @supports statements.
I would be happy to review your PR in Garden for including @supports
query.
not sure if it's the same thing @Jarzka but I was looking at how to generate @media
statements, and this almost works:
(css ["@media screen and (min-width: 470px)" {:body {:background-color "green"}}])
but I get
@media screen and (min-width: 470px) {
body-background-color: green;
}```
instead of
@media screen and (min-width: 470px) { body { background-color: green; } }```
So there is no way to actually get the right behaviour?
What about a simple raw
helper to work around these cases?
Media queries are different than feature queries, see: https://developer.mozilla.org/en-US/docs/Web/CSS/@supports
Yup. But the syntax is quite similar, so looking at the source for at-media might help if your going to implement feature-queries
I guess the supports rule has been added now?