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

@kizu @LeaVerou What would be the correct grammar for “ternary delimited” conditions, as it appears the syntax would be closer to the below:
```css
* {
  --prop: if(style(--x: 'one') ? 1 : style(--x: 'two') ? 2 : 3);
}
```
Would that use a `#` or `+` if we’re not delimiting expressions by commas or semicolons?

---

Btw @kizu I really like your idea of supporting ternary expressions in certain other functions without needing to nest `if()` similar to how we can use `calc()`-like expressions inside `max()` and others iirc.

We would not want to support them in all parenthetical contexts, would we, making `if()` optional altogether? It would need to be in a function, not simply between parentheses?

```css
* {
  --prop: (style(--x: 'one') ? 1 : style(--x: 'two') ? 2 : 3);
}
```

I think the explicit nature of `if()` will be useful for readability, but I was curious of the possibility here.



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


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

Received on Tuesday, 18 June 2024 15:37:47 UTC