Skip to content

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

@tabatkins

Description

@tabatkins

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions