Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for feature queries? #146

Open
Jarzka opened this issue Sep 29, 2017 · 6 comments
Open

Support for feature queries? #146

Jarzka opened this issue Sep 29, 2017 · 6 comments

Comments

@Jarzka
Copy link

Jarzka commented Sep 29, 2017

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.

@priyatam
Copy link
Collaborator

priyatam commented Dec 8, 2017

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

@AndreaCrotti
Copy link
Contributor

AndreaCrotti commented Dec 31, 2017

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?

@hkjels
Copy link

hkjels commented Jan 2, 2018

@Jarzka
Copy link
Author

Jarzka commented Jan 2, 2018

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

@hkjels
Copy link

hkjels commented Jan 2, 2018

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

@Jarzka
Copy link
Author

Jarzka commented Jan 24, 2019

I guess the supports rule has been added now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants