top | item 42762455

(no title)

ss64 | 1 year ago

It is built into the CSS standard

/* Dark mode */ @media (prefers-color-scheme: dark) { ... }

The issue with both dark and light modes is so many designers seem to have jumped onto the idea that colour schemes have to be either bright white or darkest black.

I'd much rather see colours that are 'slightly darker' at night and 'slightly lighter' in the daytime. For one thing there are still so many websites with no colour schemes setup at all so if you avoid going to extremes it minimises the contrast difference.

discuss

order

bee_rider|1 year ago

The dark mode background should be actually black so our OLED screens can turn their pixels off completely.

Springtime|1 year ago

The other issue is many sites don't use that CSS media query at the minimum for auto setting the theme. They instead use a Javascript approach that often involves local storage/cookies even if no choice is made, which doesn't work if those are blocked and/or Javascript disabled. In such cases the default theme is forced.

The optimal approach is applying the appropriate `prefers-color-scheme` using CSS alone, while additionally allowing a theme override using JS/storage. Fewer do this though, even though it wouldn't require any cookies and thus no consent dialog.

The worst are sites that only have theme switching gated behind registration.