Re: [csswg-drafts] [css-env] Consider value-level parsing like calc() rather than token-level like var() (#3285)

I submit for your consideration a practical case where the current parsing definition of `env()` is hostile to reasonable expectations, from https://github.com/w3c/csswg-drafts/issues/3792:

```css
margin-bottom: 15px;
margin-bottom: env(safe-area-inset-bottom, 15px);
margin-bottom: max(env(safe-area-inset-bottom, 15px), 15px);
```

First rule, fine. Second rule, fine: discarded if `env()` is not supported, and handled properly with a suitable default if it is. Third rule, the defined behaviour of `env()` means that it’s valid on `env()`-supporting browsers, but treated as `unset` if `max()` isn’t defined, and so it overrides the second rule.

The currently necessary workaround is to shift the third rule into a `@supports (margin-bottom: max(0, 15px))` block, but this is nasty.

-- 
GitHub Notification of comment by chris-morgan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3285#issuecomment-479264109 using your GitHub account

Received on Wednesday, 3 April 2019 00:05:25 UTC