Getting started
Theming
Every colour is a CSS variable. Change a variable and every component follows.
Components never use raw colours such as bg-zinc-900. They use semantic names such as bg-primary and text-muted-foreground, which Tailwind maps to the variables below.
Tokens
| Token | Used for |
|---|---|
| background / foreground | Page surface and default text. |
| card, popover | Raised surfaces: cards, menus, dialogs. |
| primary | The main action. Near-black in light mode, near-white in dark. |
| secondary, muted, accent | Quiet fills for secondary buttons, hover states and disabled areas. |
| muted-foreground | Supporting text: descriptions, placeholders, captions. |
| destructive, success | The only two hues by default. Used sparingly. |
| border, input, ring | Hairlines, field borders and the focus ring. |
| --radius | One number. sm, md, lg and xl are derived from it. |
Adding a colour
Define it for both modes, then expose it to Tailwind inside @theme inline.
:root { --warning: oklch(0.8 0.15 85); }
.dark { --warning: oklch(0.75 0.14 85); }
@theme inline {
--color-warning: var(--warning);
}Now bg-warning, text-warning and border-warning/30 all work.
Dark mode
The site toggles a .dark class on <html> with next-themes. Tailwind is told to use that class:
@custom-variant dark (&:where(.dark, .dark *));Radius
Set --radius once. 0rem gives sharp corners, 0.75rem gives soft ones. Try it in the theme builder.