Page 1 of 1

prefers-color-scheme CSS Media Feture

Posted: 2022-06-05, 22:30
by RuboGubo
Hi, I have been developing a website, and noticed that "prefers-color-scheme" does not represent the colour scheme of the operating system, which is frustrating. Just wondered if this would be something that could be easily implemented. (see the MDN Docs https://developer.mozilla.org/en-US/doc ... a_features )
I develop Mostly for the Firefox browser, and just thought i would point it out. :)

Re: prefers-color-scheme CSS Media Feture

Posted: 2022-06-05, 22:41
by Moonchild
We support this, but it is supported under the user's explicit control and choice.
This also has the side effect desired by our users that it is not a property whereby the user's system can be fingerprinted (since it is unrelated to the O.S. color scheme in use).

Re: prefers-color-scheme CSS Media Feture

Posted: 2022-06-06, 01:41
by RealityRipple
Preferences > Content > Fonts & Colors > Colors... > Web Page Color Scheme > Use light colors / Use dark colors.

Exposing the OS Color Scheme directly would not only be a fingerprinting risk, but could be used to better fake OS-styled dialogs and prompts on unsuspecting, inexperienced users.

Re: prefers-color-scheme CSS Media Feture

Posted: 2022-06-06, 04:41
by athenian200
Another thing that might be worth considering is that just because the user wants a dark theme on their OS, that may not mean they actually want all web pages serving up a dark theme to match it. That is, someone could want a dark theme on the OS but a light theme for web pages, or perhaps they want a light theme in the OS but prefer to see the dark theme of web pages. For instance, on the Pale Moon forums I use a dark theme, but I often use a light theme on the OS itself.

In any case, there is precedent for the concept. We've had a "Page Style" option under the View menu for ages, which allows switching between various alternate CSS stylesheets provided by the author. So in general our thinking is that if the author is going to provide multiple CSS stylesheets to affect the page's color scheme, then that should be no different and the user should be allowed to choose which style they prefer.

Re: prefers-color-scheme CSS Media Feture

Posted: 2022-06-15, 09:20
by moonbat
The extensions AutoPageColor (mine) and Swarth when used together both give you full control over automatic light/dark mode on a per site and time of day basis.