Theme
Every colour in the system comes from a named token. Components never reach for a palette value, so restyling the system means redefining tokens rather than overriding components.
@import "tailwindcss";
@import "antlitz/theme.css";
Tokens
| Token | Light | Dark |
|---|---|---|
| --background | oklch(98.5% 0 0) | oklch(14.5% 0 0) |
| --muted-subtle | oklch(97% 0 0) | oklch(17.5% 0 0) |
| --muted | oklch(92.2% 0 0) | oklch(20.5% 0 0) |
| --muted-hover | oklch(87% 0 0) | oklch(26.9% 0 0) |
| --foreground | oklch(14.5% 0 0) | oklch(98.5% 0 0) |
| --foreground-muted | oklch(37.1% 0 0) | oklch(87% 0 0) |
| --foreground-subtle | oklch(50% 0 0) | oklch(70.8% 0 0) |
| --foreground-danger | oklch(44.4% 0.177 26.899) | oklch(80.8% 0.114 19.571) |
| --primary | oklch(14.5% 0 0) | oklch(98.5% 0 0) |
| --primary-hover | oklch(26.9% 0 0) | oklch(87% 0 0) |
| --primary-foreground | oklch(98.5% 0 0) | oklch(14.5% 0 0) |
| --danger | oklch(57.7% 0.245 27.325) | oklch(63.7% 0.237 25.331) |
| --danger-hover | oklch(50.5% 0.213 27.518) | oklch(70.4% 0.191 22.216) |
| --danger-foreground | oklch(98.5% 0 0) | oklch(14.5% 0 0) |
| --danger-soft | oklch(93.6% 0.032 17.717) | oklch(25.8% 0.092 26.042) |
| --danger-soft-hover | oklch(88.5% 0.062 18.334) | oklch(39.6% 0.141 25.723) |
| --danger-soft-foreground | oklch(44.4% 0.177 26.899) | oklch(80.8% 0.114 19.571) |
| --success-soft | oklch(96.2% 0.044 156.743) | oklch(26.6% 0.065 152.934) |
| --success-soft-hover | oklch(92.5% 0.084 155.995) | oklch(39.3% 0.095 152.535) |
| --success-soft-foreground | oklch(44.8% 0.119 151.328) | oklch(79.2% 0.209 151.711) |
| --warning-soft | oklch(96.2% 0.059 95.617) | oklch(27.9% 0.077 45.635) |
| --warning-soft-hover | oklch(92.4% 0.12 95.746) | oklch(41.4% 0.112 45.904) |
| --warning-soft-foreground | oklch(47.3% 0.137 46.201) | oklch(82.8% 0.189 84.429) |
| --info-soft | oklch(93.2% 0.032 255.585) | oklch(28.2% 0.091 267.935) |
| --info-soft-hover | oklch(88.2% 0.059 254.128) | oklch(37.9% 0.146 265.522) |
| --info-soft-foreground | oklch(48.8% 0.243 264.376) | oklch(80.9% 0.105 251.813) |
| --border | oklch(87% 0 0) | oklch(26.9% 0 0) |
| --input | oklch(64% 0 0) | oklch(50% 0 0) |
| --ring | oklch(26.9% 0 0) | oklch(92.2% 0 0) |
| --overlay | oklch(14.5% 0 0 / 40%) | oklch(0% 0 0 / 60%) |
Each token is exposed to Tailwind as --color-<name>, so it is available
wherever a colour utility is: bg-muted, text-foreground-subtle,
border-border.
The names describe a role, not a hue. --danger is the colour of a
destructive action; --danger-soft is the quiet fill behind a message about
one. Every -foreground token is the text colour that meets contrast on the
surface of the same name.
--border divides surfaces and stays quiet. --input outlines form controls —
an unchecked Checkbox or Radio, an outline Input, Select or Textarea — and
keeps at least 3:1 against the background, the contrast WCAG asks of the edge
that identifies a control.
--overlay is the one translucent token: the backdrop behind a modal
Dialog, carrying its own alpha so that nothing applies an opacity modifier
to a token.
Overriding
Redefine a token after the import and every component that uses it follows.
@import "antlitz/theme.css";
:root {
--primary: oklch(55% 0.2 265);
--primary-hover: oklch(48% 0.2 265);
}
Values are oklch, which keeps lightness perceptually even across hues — a
-hover step darkens by the same amount whether the base is red or blue.
Dark mode
Dark values live under a .dark class, not a media query, so the choice is the
application's to make.
<html className="dark">
The variant is defined as &:where(.dark, .dark *), which adds no specificity —
a dark: utility beats its light counterpart by order alone.
Each mode also sets color-scheme, so the parts the browser draws itself — a
Select's option list, scrollbars, date pickers, autofill — follow the theme
instead of staying light.
In dark mode --primary and --danger invert: a light surface with dark text.
That keeps the text contrast and lets hover lighten the surface, which reads
better on a dark page than darkening it.
Selected text uses --primary and --primary-foreground, so a selection reads
the same in both modes.
Other tokens
--font-sans and --font-mono read --font-geist-sans and
--font-geist-mono first, so a Next.js app that loads those fonts gets them
without further configuration and any other app falls back to the system
stack.
--default-transition-duration is 150ms, which every transition in the
system inherits.
The link utility
link is the underline treatment Link and Typeset both apply, available as a
utility for anchors you style yourself.
<a href="/somewhere" className="link">
Read more
</a>