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

> Then it's a moot point. There is a lot of JavaScript code out there that relies on `matchMedia` to get the original OS preference. If `matchMedia` suddenly starts being affected by `<meta name="color-scheme">`, then it can break all this code.

Yeah it's a valid point, and we'd be in exactly the same position at the BBC. We also use `matchMedia` for our analytics to see what percentage of users have dark mode turned on in their OS settings.

The proposed change is likely to cause these kinds of compatibility issues. @fantasai 's proposal of a style query would solve this problem. We wouldn't have to worry about author's relying on the current behaviour of `prefers-color-scheme`.

However, I'm still thinking about @johannesodland's point. It's clearly useful for the _used colour scheme_ to affect `<source media="(prefers-color-scheme: dark)">` elements in `picture` element. Even if we decide not to go ahead with @tabatkins's proposal and create a style query instead, surely we should we make an exception for that?

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


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

Received on Friday, 23 August 2024 16:18:32 UTC