- From: Josh Tumath via GitHub <noreply@w3.org>
- Date: Wed, 27 Aug 2025 23:33:53 +0000
- To: public-css-archive@w3.org
I will support your proposal! It will certainly make life easier for me, too, when implementing in-page toggles – or even just forcing certain pages' colour schemes to dark mode due to a design decision. > If you object, I'm going to demand that you provide an answer as to how several non-cooperating stylesheets (that is, not written by the same author, thus not capable of depending on a page-specific convention) are supposed to be written, to both reflect user preferences in the absence of JS, and allow a JS-based toggle. And if the answer to this is anything other than "use `@media (prefers-color-scheme)`, I'll further demand you tell me what value the MQ even has, and why we shouldn't deprecate it and recommend that authors never use it. Heh. Agreed. I think @kizu [put it well earlier:](https://github.com/w3c/csswg-drafts/issues/10249#issuecomment-2322822078) > As an author, if I had a style query, I would rarely use a media query for this purpose (being the source of truth for the dark colors on the page). As it would work only on the top level, and for any nested component where I'd want to invert the color scheme, it won't work. And it is already very easy for an author to misinterpret how media query works, and use it for components, breaking them when they are inserted into an inverted context. With some kind of style query or pseudo-class to change styles based on the colour scheme, I would never use the media query for the actual design of the page. Its only use for me would be for analytics. In the BBC, we use it to measure what percentage of users have enabled dark mode in order to convince internal stakeholders that the feature is popular enough to support it on our website. -- GitHub Notification of comment by JoshTumath Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10249#issuecomment-3230126692 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 27 August 2025 23:33:54 UTC