← Back to release summary
CSS Color Adjust: Remove 'only' and support used 'dark' for preferred 'light' for color-scheme
- Category
- CSS
- Type
- New or changed feature
- Status
- Enabled by default (Chrome 85)
- Intent stage
- Evaluate readiness to ship
Summary
The color-scheme property from CSS Color Adjustment level 1 spec changed in two ways.
1. The 'only' keyword is no longer special and is treated as a <custom-ident> as any other unknown color-scheme. The 'only' keyword was previously only allowed in combination with 'light', but had otherwise no effect in Chrome.
2. 'color-scheme: dark' will have a used value of 'dark' even when preferred color-scheme is 'light'. 'color-scheme: light dark' still has a used values based on the preferred scheme.
Motivation
The spec has changed which allows page author to use dark themed UA rendering even when the preferred color-scheme is 'light'. The new behavior is:
color-scheme: light -> always light
color-scheme: dark -> always dark
color-scheme: light dark -> select the preferred scheme
This means content which always have a dark theme in their CSS will be able to match that with dark themed UA controls.
It also improves interoperability with WebKit which already had this behavior for 'color-scheme: dark'.
Standards & signals
- Specification: https://drafts.csswg.org/css-color-adjust-1/#color-scheme-prop
- Firefox: No signal — Mozilla were originally opposed to support a used 'dark' value when the preferred scheme was 'light' because user agents using system form control rendering would not be able to use dark themed controls when the system preference was a light, which led to the spec originally being written as it was.
The plan for Firefox is to move away from system controls:
https://github.com/w3c/csswg-drafts/issues/3881#issuecomment-634463620
From the CSSWG meeting notes for this resolution:
"emilio: uneasy about overwriting user preference. Not really objecting"
- Safari: Shipped/Shipping — 'only' still has a separate meaning in Safari for opting out of UA color transformations.
- Web developers: No signals
- Tracking bug: https://crbug.com/1087115
View on chromestatus.com