- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Fri, 30 Aug 2024 22:14:16 +0000
- To: public-css-archive@w3.org
> There is an important distinction between it and the user preferences. The @media (prefers-color-scheme) is specifically about the user preference, and not about the used color scheme. Ignoring the effect of actually setting the 'color-scheme' property, I must ask once again - what is the benefit to authors of this distinction? Is there a benefit to *anyone else*, either? I think the answer is definitely no. Excepting the corner cases already discussed (analytics and JS-based color pickers, which can pick up the information from some other JS API instead and don't require the MQ itself), afaict there is *absolutely no reason* an author would *ever* want to style a page based on the current user preference when the page has `<meta name=color-scheme content=dark>`. The used color scheme is gonna be dark (unless some other styles explicitly override that with a `color-scheme` property), so the user preference is light, *the MQ will select the wrong colors and the page will have a broken appearance*. Similarly, I don't see any *user* benefit to this. Pages can already ignore the user preference whenever they like by just not using the MQ at all. If an author has explicitly set the page's color scheme, it similarly is an indication that they know they're using a particular scheme regardless of user preference. (And, importantly, a big reason to do so is specifically to *reflect* a user preference from an in-page color-scheme picker! See <https://github.com/speced/respec/issues/4687> for an example.) Afaict, having the MQ strictly reflect the user preference only brings the possibility of *hurting* the user, due to a page's colors being broken because of a mismatch in MQ and used color-scheme. So as far as I can tell the only party to benefit from "(prefers-color-scheme) must strictly match the user preference" is Theoretical Purity, the lowest of all our constituencies. (And, to a tiny degree, browsers, just because it means they don't have to make any change.) Because `(prefers-color-scheme)` is *labeled* a "user-preference media query", it *seems to make sense* that it strictly reflects the user preference. But we need to take a broader view and make sure we're best serving the *actual purpose* of the MQ, not what we happened to have used to describe it. And that purpose is "select the correct set of colors, and related styles, to reflect the page's color scheme (which can be set by the user)". -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10249#issuecomment-2322440411 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 30 August 2024 22:14:17 UTC