Alpha: Ships on npm at 7.0.0-alpha.07.0.0-alpha.0
Dark mode
Light is the full palette on :root. Dark redefines only the roles that change, under the reader's prefers-color-scheme.
What each Theme emits
| Theme | Dark palette | scheme | Document color-scheme |
|---|---|---|---|
certificate | yes | auto | light dark |
vaultline | no | auto | light |
quaypoint | yes | light | light |
callboard | yes | light | light |
directory | yes | auto | light dark |
- certificate and directory emit dark. The page follows the reader's scheme.
- quaypoint and callboard declare a dark palette and set
scheme: 'light'.compileThemechecks the palette and emits none of it. - vaultline declares no dark palette. Its page is light in every scheme.
See it
Pick a Theme. Where it emits dark, the toggle swaps between its two real renders: the dark one is the build's twin with the Theme's own dark media query switched on. Where it does not, the page shows the declared palette as values and draws no dark render.
The rules
- No color gets its only definition inside the dark media query. Every role has a light value first.
- An invariant role is declared once and never redefined for dark.
compileThemerefuses one that appears indark. The code window is dark in both schemes. scheme: 'light'keeps the dark palette declared and checked, and emits none of it. Changing that one word toautoturns dark mode on.- The document's
color-schemeislight darkwhen the Theme emits a dark palette, andlightotherwise.
Previews on these docs
Every preview on these docs follows the same rule. The scheme control is on only for certificate and directory, and it swaps to the dark twin; for the other three it stays off, with "Light only by this Theme's policy". No preview inverts a light render.