[csswg-drafts] [css-color-adjust-1] Allow a page to express a theme pref when the user doesn't (#3850)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-adjust-1] Allow a page to express a theme pref when the user doesn't ==
Rune's spec's processing algorithm handled two cases: letting the page pref win (using "only"), user pref be damned; and letting the user pref win (not using "only"), page pref be damned.  If the user doesn't express a preference, and the page doesn't *force* one, the page automatically gets rendered with "light".

This misses an important use-case, where a page would like to express a *default* preference for one color scheme, but let the user pref, when it exists, win out. (That is, a page might *prefer* dark-mode and want dark form controls/etc by default, but be fine with rendering in light mode if the user actually wants light mode.)

I've modified Rune's algorithm in the spec to allow this: if the user doesn't have a preference, then the first understood value in 'color-scheme' is used. So a page that prefers dark-mode but doesn't want to force it can say `color-scheme: dark light` and get what it wants.

Does this sound reasonable?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3850 using your GitHub account

Received on Thursday, 18 April 2019 23:39:10 UTC