Re: [csswg-drafts] [css-values-5] if() conditions with calc() comparisons (#11104)

`if()` is defined to resolve at computed-value time. But this needs layout:

```css
width: if( (100% > 200px): max-content; else : stretch; );
```

So I guess it needs to be invalid? But it would be cool to have an `if()` as a syntax sugar for arithmetic conditionals, e.g.

```css
width: if( (100% > 200px): 1em; else : 1lh; );
/* behaves like this: */
width: calc(max(0, sign(100% - 200px)) * 1em + (1 - max(0, sign(100% - 200px))) * 1lh)
```

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


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

Received on Tuesday, 29 October 2024 00:38:15 UTC