Search
Search pages, pieces and blocks.
Day and Night
Night is never brighter than 300. Every piece reads its roles, the roles change, and nothing else has to know which theme it is in.
- Switch
- class on html
- Change
- circle, 400
- Ceiling
- 300 #e2e2e1
In a real piece
The same card in both, side by side. This works because .light and .dark can be set on any part of the page.
Day

Night

How switching works
- 1The toggle asks next-themes for the other themetheme-toggle.tsx, classes { light: "theme-light", dark: "dark" } on html
- 2Tokens swap, and no piece asks for the themeThe .dark block in globals.css re-points every role. No piece reads the theme in script; 36 files in src/components/ui add dark: classes, 106 in all, where a role alone falls short.
- 3The new theme grows as a circle from the buttondocument.startViewTransition, clip-path circle over --duration-theme 400 on --ease-even
- 4Reduced motion or no View Transitions: at onceTransitions are held off for one frame, so nothing fades through the change
- 5A part of the page can keep its own themedark: is (&:is(.dark *):not(.light *)), so .light inside Night brings Day back
The 300 ceiling
Night uses the scale from 975 up to 300 and stops. The number under a step is how many Night roles point at it. Day steps 50 to 250 are never used in Night.
- 50
- 100
- 150
- 200
- 250
- 3004
- 350
- 4001
- 4501
- 5002
- 550
- 6001
- 650
- 7003
- 750
- 800
- 825
- 850
- 8753
- 9006
- 9502
- 9755
- 990
| Lightest Night values | OKLCH L | What it is |
|---|---|---|
| --foreground | 0.913 | foreground, primary, ring and chart-1 all stop at 300 #e2e2e1 |
| --chart-2 | 0.845 | The second chart series |
| --destructive-ink | 0.820 | The lightest status ink, under the ceiling |
| --range | 0.801 | The Slider's filled part |
Images and marks in Night
No filter, no dimming. Avatar draws its edge with after:border-border, mix-blend darken in Day and lighten in Night, so a dark photo still has an edge.
Icons and the Brand Mark take currentColor. On marks are Primary, so a Night Checkbox is a 300 square with a 975 check. The off Switch thumb turns muted-foreground.
.brand-sample carries a brand to Primary and the ring: #0f766e in Day, #5fb8ac in Night, lifted so it reads on #1f1f1e.
Do and don't
Rules
- 1Never write a colour for Night. Use the role; the .dark block does the rest.
- 2Nothing in Night is lighter than 300. If text looks dim, the surface is too light, not the text too dark.
- 3Check both themes. The pairs on the Colour page clear 4.5:1 for text and 3:1 for edges in Day and in Night; a new pair has to as well.
- 4A sample, a code block or a preview may pin its theme with .light or .dark. A page may not.