antlitz
Menu

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

TokenLightDark
--backgroundoklch(98.5% 0 0)oklch(14.5% 0 0)
--muted-subtleoklch(97% 0 0)oklch(17.5% 0 0)
--mutedoklch(92.2% 0 0)oklch(20.5% 0 0)
--muted-hoveroklch(87% 0 0)oklch(26.9% 0 0)
--foregroundoklch(14.5% 0 0)oklch(98.5% 0 0)
--foreground-mutedoklch(37.1% 0 0)oklch(87% 0 0)
--foreground-subtleoklch(50% 0 0)oklch(70.8% 0 0)
--foreground-dangeroklch(44.4% 0.177 26.899)oklch(80.8% 0.114 19.571)
--primaryoklch(14.5% 0 0)oklch(98.5% 0 0)
--primary-hoveroklch(26.9% 0 0)oklch(87% 0 0)
--primary-foregroundoklch(98.5% 0 0)oklch(14.5% 0 0)
--dangeroklch(57.7% 0.245 27.325)oklch(63.7% 0.237 25.331)
--danger-hoveroklch(50.5% 0.213 27.518)oklch(70.4% 0.191 22.216)
--danger-foregroundoklch(98.5% 0 0)oklch(14.5% 0 0)
--danger-softoklch(93.6% 0.032 17.717)oklch(25.8% 0.092 26.042)
--danger-soft-hoveroklch(88.5% 0.062 18.334)oklch(39.6% 0.141 25.723)
--danger-soft-foregroundoklch(44.4% 0.177 26.899)oklch(80.8% 0.114 19.571)
--success-softoklch(96.2% 0.044 156.743)oklch(26.6% 0.065 152.934)
--success-soft-hoveroklch(92.5% 0.084 155.995)oklch(39.3% 0.095 152.535)
--success-soft-foregroundoklch(44.8% 0.119 151.328)oklch(79.2% 0.209 151.711)
--warning-softoklch(96.2% 0.059 95.617)oklch(27.9% 0.077 45.635)
--warning-soft-hoveroklch(92.4% 0.12 95.746)oklch(41.4% 0.112 45.904)
--warning-soft-foregroundoklch(47.3% 0.137 46.201)oklch(82.8% 0.189 84.429)
--info-softoklch(93.2% 0.032 255.585)oklch(28.2% 0.091 267.935)
--info-soft-hoveroklch(88.2% 0.059 254.128)oklch(37.9% 0.146 265.522)
--info-soft-foregroundoklch(48.8% 0.243 264.376)oklch(80.9% 0.105 251.813)
--borderoklch(87% 0 0)oklch(26.9% 0 0)
--inputoklch(64% 0 0)oklch(50% 0 0)
--ringoklch(26.9% 0 0)oklch(92.2% 0 0)
--overlayoklch(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>