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

Authors may want a switch like this to apply by

- numeric index (probably one-based): `1`, `2`, `3`
- numeric index range: `1-2`, `3` and up
- logical condition (effectively resulting in a numeric index range): `<2`, `>3`
- arbitrary key: `1`, `foo`, `bar`
- arbitrary key list: `1-2`, `foo | bar`

Iʼm pretty sure there are reasonable use cases for all of these, even if we do not have generic key-value arrays in CSS (yet). The question is: should they all be supported within a single function?

(I hate that most programming languages only have single-value case conditions in their switch statement, but I actually like its cascading nature, although most people treat a break statement as mandatory within cases.) 

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

Received on Friday, 8 May 2020 07:43:26 UTC