Docs

Customization

Colors

Replace the neutral palette with accessible semantic colors for light and dark modes.

All application colors are defined in app/globals.css. Tailwind's inline theme maps names such as bg-primary and text-muted-foreground to CSS variables.

Core tokens

Token pairTypical use
background / foregroundPage canvas and default text
card / card-foregroundRaised surfaces
primary / primary-foregroundPrimary actions and emphasis
secondary / secondary-foregroundSecondary controls
muted / muted-foregroundQuiet surfaces and supporting text
accent / accent-foregroundHover and selected states
destructiveDangerous actions and errors
border, input, ringBoundaries and focus indicators

Apply a brand color

Define values in both palettes:

app/globals.css
:root {
  --primary: oklch(0.52 0.22 264);
  --primary-foreground: oklch(0.985 0 0);
  --ring: oklch(0.62 0.18 264);
}

.dark {
  --primary: oklch(0.72 0.16 264);
  --primary-foreground: oklch(0.16 0.03 264);
  --ring: oklch(0.64 0.15 264);
}

Components automatically consume the result:

<button className="bg-primary text-primary-foreground focus-visible:ring-ring">
  Get started
</button>

Sidebar tokens are separate so the navigation can have a distinct surface. Chart tokens provide a predictable sequence for diagrams:

:root {
  --sidebar: oklch(0.98 0.01 264);
  --sidebar-primary: var(--primary);
  --chart-1: oklch(0.65 0.2 30);
}

Best practices

  • Keep foreground tokens readable against their paired backgrounds.
  • Check normal, hover, active, disabled, and focus states.
  • Prefer OKLCH for perceptually consistent changes.
  • Avoid using primary for every decoration; it should retain meaning.

Warning: A palette that looks balanced in light mode may fail contrast in dark mode. Validate both modes with browser accessibility tools.

On this page