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

> @mindplay-dk @Link2Twenty Believe me, we’d all LOVE to do `@if` and do it properly, and [me more than anyone](https://github.com/w3c/csswg-drafts/issues/5624). However, there are currently technical constraints that prevent us from doing so, ...

I wonder why you (or anyone else in this thread) didn't mention it so far, though there _are already_ general conditional at-rules named [`@when` and `@else` in CSS Conditional 5](https://drafts.csswg.org/css-conditional-5/#when-rule).
So far, they only cover `@supports` and `@media` use cases, though. I.e. they do _not_ cover (custom) properties at the moment. This is due to the technical constraints mentioned.

And yes, an inline solution and a structural solution don't exclude each other, though this proposal explicitly discusses an inline conditional solution. Any structural solution should be discussed separately.
I'd just note that both should be aligned with each other, i.e. use the same keyword (so probably `when()`) and functions (e.g. `style()` as initially suggested plus `media()` and `supports()` and possibly others).

Sebastian

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


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

Received on Monday, 2 September 2024 19:25:13 UTC