Re: [csswg-drafts] [mediaqueries] Effect of <meta name=color-scheme> on the (prefers-color-scheme) MQ (#10249)

The media query `prefers-color-scheme` is *always* about a user preference as configured in the browser or operating system settings. The [`color-scheme`](https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme) `<meta>` in HTML is set by the author, but *may* be informed by a user choice expressed in the webpage. Since it *could* still just reflect the author’s preference it *must not* compete with the actual user preference. That is the author’s job to handle, not the W3C’s nor the browser’s!

That is, if they are using the `meta`, they should probably not be using the MQ, but to achieve this, in-page switches for user preferences would need to be able to absolve from CSS in a different way. The usual and proper way would be a pseudo-class **selector**, i.e. either `:light` and `:dark` or `:color-scheme()`, because those frequently depend on the host markup. In most cases they are not the same document-wide, but I am not the one to know whether this metadata may become available for certain elements on the page independently. 

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


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

Received on Saturday, 31 August 2024 13:20:38 UTC