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

> If you specify <meta name=color-scheme content=dark> it means "my page only supports dark mode", so why do you even need to query the prefers-color-scheme media query in the first place? Can't you just write your page with dark colors?

Your CSS can easily be written for a wide variety of pages (supplying both light and dark styles), and the meta only used to force a color-scheme on certain ones. (what @JoshTumath said)

(The in-page color-scheme toggle is also a use-case, and in fact why I originally ran into it, but the Web Preferences API is the better solution for this anyway, so I'm not gonna lean on that as as argument.)

But there's also, more generally, the author-consistency/advice argument. We allow *some* `meta`s to affect the page in a way that is visible to MQs (namely, `<meta name=viewport>`). Having a consistent rule that `meta` elements can affect MQs would mean one less thing for authors to have to learn - given a particular chunk of HTML, whatever the result of that HTML is on the relevant qualities of the page, that's what the MQ tests on.

As I said, I don't see what the author-benefit argument is for allowing the MQ to match on a value that the page is *not* using. Why do we want to give authors a confusing MQ, when we can just as easily make it match expectations?

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


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

Received on Thursday, 22 August 2024 21:30:34 UTC