W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2019

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

From: Chris Morgan via GitHub <sysbot+gh@w3.org>
Date: Wed, 03 Apr 2019 00:05:24 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-479264109-1554249922-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:06 UTC