Re: [csswg-drafts] [css-conditional][selectors] A way to set styles according to the used color scheme (#12681)

> I agree that a CQ for this is appropriate, testing a style queries container, called `color-scheme()`. This matches the `if()` proposal in [#10577 (comment)](https://github.com/w3c/csswg-drafts/issues/10577#issuecomment-3104198955). It would have the standard difference with `if()`, in that as a CQ it can only test ancestors of an element, while `if()` tests on the element itself.

Do we actually need a new function? The `style()` syntax was always defined to take regular properties, and custom properties were the start. While it will be insanely hard to do for any property, it seems just as feasible to implement `style(color-scheme: dark)` and doesn't add more API surface.

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


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

Received on Saturday, 30 August 2025 10:12:32 UTC