CKTIS / CSS
color-scheme — supported color schemes
color-scheme declares support for light or dark rendering, affecting native controls and system colors.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
color-scheme: normal | [ light | dark | <custom-ident> ]+ && only?;color-scheme is inherited. Its initial value, normal, declares no supported color schemes. The browser’s default scheme is the fallback: without only, the browser can use a different scheme to honor an overriding user preference. A descendant explicitly set to normal can render differently from a page root that uses dark.
light dark supports both schemes and considers the user’s preference. Without a preference, the first supported scheme wins. only light prevents browser scheme overrides but does not disable forced colors mode.
The property does not replace your palette or prefers-color-scheme queries. The system colors Canvas and CanvasText provide a matching background/text pair. Their exact values depend on the environment.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>color-scheme</title>
<style>
:root { color-scheme: light dark; }
body { background: Canvas; color: CanvasText; }
section { padding: 1rem; margin: 1rem 0; background: Canvas; color: CanvasText; }
.light { color-scheme: only light; }
.dark { color-scheme: only dark; }
</style>
<section class="light">
<label>Light <input value="Sample"></label>
</section>
<section class="dark">
<label>Dark <input value="Sample"></label>
</section>
</html>Result
With light and dark schemes supported and forced colors disabled, Light uses a light scheme and Dark uses a dark scheme under either user preference. Exact colors and native input styling vary.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.