[csswg-drafts] [mediaqueries-5] [css-env] Replace `@custom-media` with custom environment variables? (#6698)

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

== [mediaqueries-5] [css-env] Replace `@custom-media` with custom environment variables? ==
An [issue in the css-env spec](https://drafts.csswg.org/css-env/#issue-9ee89738) says:

> ISSUE 3. Define the full set of places env() can be used.
> * Should be able to replace any subset of MQ syntax, for example.

This made me think if we could define custom environment variables and use them in `@media` queries, would there still be a need for [`@custom-media`](https://drafts.csswg.org/mediaqueries-5/#custom-mq) or would it become redundant.

That could look something like the following:

```css
@env --narrow-window (max-width: 30em);

@media env(--narrow-window) {
  /* ... */
}
```

(The syntax could be different, of course, as the syntax for defining custom environment variables hasn’t yet been decided.)

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 29 September 2021 21:04:18 UTC