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

The syntax as described makes it slightly impossible to say "else be IACVT" in some cases. (For these examples, I'm gonna assume we use `:` between the condition and value, btw.)

`if(style(...): foo, bar)` could be a single value `foo, bar` (and IACVT if false), or two values (`foo` if true, `bar` if false). This *does* have a defined parse - it's always two values. But if you *wanted* it to be one value, and then IACVT for false, you can't write that.

(This ambiguity doesn't occur if there are multiple chained conditions. `if(style(...) foo; style(...) bar, baz)` unambiguously doesn't have a default case; the `bar, baz` is the whole value for the second condition. It's only in the single-condition case that we haven't yet gotten unambiguous information about what the separator is.)

So I think we'll need an explicit syntax for saying "no default condition". You don't *usually* need it, but occasionally you will, and it might make some cases clear even when it's not strictly required. Like, `if(style(...) foo, bar; no-value)` or something. (Special keyword, allowed only as the whole value of the final argument, always matches but resolves to the guaranteed-invalid value.)

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


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

Received on Thursday, 13 June 2024 10:15:43 UTC