Closed quasicomputational closed 5 years ago
Possibly, but the fear as always with this sort of thing is that a page will type "any" because it's shorter than "light dark", even tho it would actually look bad if, say, "sepia" was used.
A user can always force a page into supporting a color scheme with a *{color-scheme: foo !important;}
declaration in their user stylesheet (or the UA can fake it with similar mechanics behind-the-scenes), so I don't think this addition is worth the risk of it being misused.
I disagree that this is something that would be misused. If a website design really works for both light and dark styles, as implemented by any current or future browser, it's unlikely to break for anything in between. I think the worse issue is in not allowing authors to create forward-focused stylesheets that also respect user preferences.
I'd go one step forward, and argue that any
should include any user agent color scheme, including ones that haven't yet been standardized in CSS with a particular name.
A keyword like any
is clear enough. But we could go with color-scheme: whatever
or color-scheme: as-you-wish
if you really don't want anyone using it without thinking about anything other than character counts.
A user can always force a page into supporting a color scheme
But this isn't about users forcing color schemes. This is about authors stating that this page or section of a page, can safely be styled in any color scheme.
The CSS Working Group just discussed Let pages opt in to any scheme
, and agreed to the following:
RESOLVED: Reject this issue
Closing out as rejected. We may reconsider in the future, but given how dangerously misunderstood this feature could be, the convenience is not worth it; and furthermore, due to the subtlety of correctly handling it, the possibility of some pages using it correctly for future-proofing is more than offset by the likelihood that actual usage would create future pitfalls.
I think it'd make sense to add something like
color-scheme: any
to indicate that the element is entirely agnostic to the colours that are used (i.e., it's careful to only usecurrentColor
and system colours, never sets background without setting foreground and vice versa, etc), so whatever colour scheme the user most prefers can be used without fear of breakage. This would work better thancolor-scheme: light dark
as it's future-proof against schemes getting added later.