Re: [csswg-drafts] [css-values-5] What is the MVP for inline conditionals on custom properties? (#10064)

@tabatkins
> With the condition that `else` is only valid in the final pair.

If the semantics are first true condition wins (which is the easiest to implement and understand, especially) and `else` is defined to always match then it's valid everywhere but probably only means what you want when it's at the end. This allows some printf debugging by sticking an `else` in the middle, and it's easy enough for linters to detect and warn about a medial else.

Alternately you could define it as matching whenever nothing else matches so that it's valid anywhere (but only once). I don't think this buys much over the simpler rule.

@kizu I don't understand why it would be good to allow `if(x?y:z)` and `calc(x?y:z)`. That would make `if` by itself fairly useless once the latter lands. Why not skip straight to `calc(x?y:z)`? [I much prefer the switch style to the ternary but note that both could exist if the ternary is just a regular calc expression] 

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 24 June 2024 18:06:39 UTC