Re: [csswg-drafts] [css-values]: Express conditional values in a more terse way (#5009)

> If we do something like this, can it also cover use cases where you basically need a ternary instead of tying it to media queries? E.g. things like border-width: if(100% < 50vw, 1px, 2px). 

Yes, we could. We could widen the grammar of the first argument to `<integer> | <conditional>` (defining a calc-ish conditional with the same grammar structure as MQ/supports), and then if you use a conditional we select either the first or second value if it's true/false. (We'd probably allow more than two values, but third onward just would never be selected by a conditional argument.)

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

Received on Friday, 8 May 2020 00:24:28 UTC