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

> hy not simply make the last argument mandatory and allow empty values (just like var())?

That's possible, I just find it less clear to read. I don't really like how `var()` allowed it.

> One advantage of having a special value (e.g. revert-declaration?) is that perhaps we can improve on the IACVT behavior by keeping other declarations around when that is encountered (but probably we can't).

I'm not trying to solve any feature lack, just a syntax lack around the existing features.

> If that’s not an option, I'd rather introduce a different separator than a whole keyword. I’m generally all for prioritizing readability, but readability is a balance: too concise and it doesn't make sense, too wordy and you have to wade through the clutter to understand it. With something that I expect will be used all over the place, conciseness matters quite a lot.

We can't invent infinite separators. ^_^ But also, this is something that is *rarely* needed - like I said, the only case that *requires* it is when you want to supply a single test, with a positive value containing a comma, and no negative value. If you *do* want to use it for clarity in other cases, I think it's perfectly readable. For example:

```css
background-color: if(
 style(--variant: success): var(--color-success-60), 
 style(--variant: warning): var(--color-warning-60),
 style(--variant: danger): var(--color-danger-60), 
 style(--variant: primary): var(--color-primary),
 no-value
);

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10064#issuecomment-2165273112 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:37:19 UTC