[csswg-drafts] [css-env][css-conditional] Need an approach to check whether an environment variable is supported (#3576)

upsuper has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-env][css-conditional] Need an approach to check whether an environment variable is supported ==
Websites need to detect whether an environment variable is support in order to have special rules applied on it. It seems there is currently no way to do that.

Natively authors would just use something like
```css
@supports (padding-top: env(safe-area-inset-top)) { ... }
```
for the detection, but the only thing it checks is that `env` is supported. If you replace `safe-area-inset-top` with something else like `x`, all implementations nowadays would still happily accept it. This is problematic for future extensions.

I'm not sure whether #3285 would solve this (and breaks things like `env(x)` in `@supports`). If not, we probably need to either special-case the behavior of `env` in `@supports`, or introduce a function for it.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3576 using your GitHub account

Received on Thursday, 31 January 2019 05:50:30 UTC