← Back to release summary

CSS Color Adjust: 'only' keyword for color-scheme

Category
CSS
Type
No developer-visible change
Status
Enabled by default (Chrome 98)
Intent stage
Shipped

Summary

The 'only' keyword has been re-added to the specification for color-scheme as a way of per-element opt-out of color-scheme override like forced darkening. div { color-scheme: light } will force the div element into color-scheme dark and apply forced darkening. div { color-scheme: only light } will keep the color-scheme for the element light and opt-out of forced darkening.

Motivation

This feature can be used to do per element opt-out of color-scheme overrides like forced darkening.

Standards & signals

View on chromestatus.com