- From: Josh Tumath via GitHub <noreply@w3.org>
- Date: Thu, 28 Aug 2025 00:03:12 +0000
- To: public-css-archive@w3.org
I really _want_ to support your proposal, @tabatkins! It would 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. However, as previously discussed, getting the user's actual preference is still useful. As I said earlier in the issue, in the BBC, we used 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. (It turned out about 20-25% of visitors enabled dark mode.) So by going ahead with this proposal, our analytics data would become incorrect on pages where we set `only dark` in the meta tag. > 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. > > [...] > > I'll be ok with the `<meta>` impacting the media query, if both an author and a user will still be able to somehow get the _actual_ value of `prefers-color-scheme` and adjust things accordingly. With some kind of style query or pseudo-class to change styles based on the colour scheme, _I would never want to use the `prefers-color-scheme` media query for implementing the actual design of a page._ As long as we can agree to have some other way via an API to get the user's actual OS/UA colour scheme setting, I will support your proposal, Tab. -- GitHub Notification of comment by JoshTumath Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10249#issuecomment-3230222547 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 28 August 2025 00:03:13 UTC