Post

QQ about Dark Mode Toggles on websites How many options do you show to users? - Three values: System, Light, or Dark - Two values: Light, Dark (with one of them mapping to “System” behind the scenes). Why the one or the other? (I have an opinion about it, but I’m looking for external input)

Three values, follow system is quite different intent wise from picking a specific theme. If my system automatically changes at night to dark mode I want that behaviour. But also I light want this specific site to always remain light mode.

as a developer, same. as a (tech savvy) user, i really just want browsers to easily let me override prefers-color-scheme on a per-website basis

Blasphemous I know. But failing them giving the user an option they should give developers better primitives to implement it. Like say scripting control of preference media queries 😉.

0 reposts2 likes

Once browsers update the media query to reflect the page color-scheme, do you think there’s still a strong need to the User Preferences API? Toggling the color-scheme meta tag with JS will have a similar effect.

Yes for two reasons, I think the persistence will help make things work more seamlessly. But also there's more than just color scheme preference too so it's still useful for contrast, for example. Also fwiw I don't personally think that mentioned change is a great idea, but we'll see how it goes.

I don't think it materially helps authors much and we should probably be pushing people towards using -light-dark() instead. That way their components automatically adapt if a section of the page has an opposite color scheme.