Re: [csswg-drafts] [css-env] Adding custom env() variables (#2627)

@tomhodgins re

> What would the advantage of 'custom env() variables' ...

media queries can't use `var`, because they are not attached to an element.

Use case: in `css`, define `--minW: 400 px;` Now wish to create a media query:
`@media (max-width: 400 px) {}`
Except instead of hard-coding `400 px`, use `--minW`. Can't.

(In my case, I have a calculated font size that grows/shrinks based on window width, but stops at min/max values at specified min/max width. Unless `if ... then ... else ...` expression is added to `css`, this requires media queries at the min/max widths, to override the formula. Or must use a pre-processor. or javascript. Would be nice to not need a pre-processor. OTOH, TBD at what point it stops being worth burdening `css` parsers with additional functionality.)

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

Received on Thursday, 31 October 2019 14:19:32 UTC