garden icon indicating copy to clipboard operation
garden copied to clipboard

Support for feature queries?

Open Jarzka opened this issue 6 years ago • 6 comments

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.

Jarzka avatar Sep 29 '17 15:09 Jarzka

I would be happy to review your PR in Garden for including @supports query.

priyatam avatar Dec 08 '17 03:12 priyatam

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?

AndreaCrotti avatar Dec 31 '17 13:12 AndreaCrotti

Media queries are different than feature queries, see: https://developer.mozilla.org/en-US/docs/Web/CSS/@supports

Jarzka avatar Jan 02 '18 08:01 Jarzka

Yup. But the syntax is quite similar, so looking at the source for at-media might help if your going to implement feature-queries

hkjels avatar Jan 02 '18 09:01 hkjels

I guess the supports rule has been added now?

Jarzka avatar Jan 24 '19 16:01 Jarzka