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

> I explained that in a previous comment, that you may not want to define a full matrix of values for every mq "level", and perhaps repeating the last value is good enough for quite a few definitions.

Assuming that there's only one dimension you might want to omit (so you can put it at the end) seems a bit fraught, but...

> Which also means that if you add another level and forget to update some declaration(s), things keep working.

...this is more interesting. I'm not entirely sure it's *right* tho - sometimes we *do* want things to fail obviously, to draw the author's attention to it and make it more likely to be fixed. Clamping makes the assumption that, in the case of this sort of mistake, the author would be okay with using whatever was last in their list, which has no guarantee of being appropriate to combine with the other values from the new set.

(Note that if we do go with "invalid", `switch(calc(100000); ...)` will indeed clamp to the last valid index, so at least authors *could* activate the behavior manually if they want.)

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

Received on Friday, 8 May 2020 15:53:16 UTC