prefers-color-scheme CSS Media Feture

Discussions about the development and maturation of the platform code (GRE).
Warning: may contain highly-technical topics.

Moderators: trava90, athenian200

User avatar
RuboGubo
New to the forum
New to the forum
Posts: 1
Joined: 2022-06-05, 22:12

prefers-color-scheme CSS Media Feture

Unread post by RuboGubo » 2022-06-05, 22:30

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. :)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 32197
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: prefers-color-scheme CSS Media Feture

Unread post by Moonchild » 2022-06-05, 22:41

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).
"You will observe with concern how long a useful truth may be known and exist before it is generally received and practiced on." -- Benjamin Franklin
"Compromise and collaboration lie at the heart of all great endeavours" -- Kassandra
Image

User avatar
RealityRipple
Astronaut
Astronaut
Posts: 505
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: prefers-color-scheme CSS Media Feture

Unread post by RealityRipple » 2022-06-06, 01:41

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.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 668
Joined: 2018-10-28, 19:56
Location: Georgia
Contact:

Re: prefers-color-scheme CSS Media Feture

Unread post by athenian200 » 2022-06-06, 04:41

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.
"There are two sentences inscribed upon the Ancient oracle... 'Know thyself' and 'Nothing too much'; and upon these all other precepts depend." -- Plutarch

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 3952
Joined: 2015-12-09, 15:45
Contact:

Re: prefers-color-scheme CSS Media Feture

Unread post by moonbat » 2022-06-15, 09:20

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.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 20.1 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

Post Reply