Re: [csswg-drafts] passing native theme colors to CSS (#12837)

@sashafirsov What @emilio [described in the Firefox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1983200#c6) is that if the theme switch were done automatically, many sites that expect a light theme but set either only the background or the text color would be broken.
And the example page you posted is a good example for that issue, as it sets `background-color: lightgreen;` but no `text-color`. So in dark mode the text in the table is white.

<img width="1011" height="499" alt="Image" src="https://github.com/user-attachments/assets/5dddedba-98c8-40a4-b660-28bf2a5447a9" />

Therefore, websites have to explicitly opt into using the OS's color scheme. And that is done by setting [`color-scheme: light dark;`](https://www.w3.org/TR/css-color-adjust-1/#color-scheme-prop) in CSS or [`<meta name=color-scheme content="light dark">`](https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme) in HTML.
With that opt-in, the system color keywords reflect the native theme's colors.

And, if I am not mistaken, that is exactly what you are asking for. So I close this issue. If you have something else in mind, feel free to reopen this issue. In that case, please explain what's still missing.

Sebastian

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


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

Received on Monday, 22 September 2025 09:07:25 UTC