- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Sun, 26 Feb 2023 20:29:13 +0000
- To: public-css-archive@w3.org
Glancing over your proposal, it seems you want:
- A way to use variables in `@media`. This can be covered by #2627
- A way to define lists and extract items from lists. This can be covered by `spread()` from #8391 and `nth-value()` from https://github.com/w3c/csswg-drafts/issues/5009#issuecomment-785524020. I don't think this part seems particularly useful in your case, though.
Your example could then be something like
```css
@custom-env --small 200px;
@custom-env --big 600px;
@media (width <= env(--big)) { /* @media (width <= 600px) { */
.menuBar { display: none; }
}
@media (width <= env(--small)) { /* @media (width <= 200px) { */
.menuBar { display: none; }
}
```
or
```css
@custom-env --sizes spread(200px; 600px);
@media (width <= nth-value(2; env(--sizes))) { /* @media (width <= 600px) { */
.menuBar { display: none; }
}
@media (width <= nth-value(1; env(--sizes))) { /* @media (width <= 200px) { */
.menuBar { display: none; }
}
```
--
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8472#issuecomment-1445459403 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 26 February 2023 20:29:15 UTC