Colour theme

ThemeSwitch

  • Primitives

  • fields

ThemeSwitch

Resolves a colour-scheme preference against the OS signal and reflects the answer on<html> as data-appearance. System projects no attribute at all — its absence is the state, and color-scheme: light dark already delegates to the OS. Only the live demo below is attached; the state rows are inert copies, so they cannot re-theme the page.

Live demo

Colour theme

Interaction states

Default

Interaction state: default

Hover

Interaction state: hover

Focus

Interaction state: focus

Active

Interaction state: active

Disabled

Colour theme (unavailable)

Resolved state

preference—
appearance—
prefers-color-scheme: dark—
<html data-appearance>—