Getting Started
Tailwind Classes
Our design tokens are CSS custom properties. Tailwind v4 exposes them as utility classes through the @theme inline directive in each app's globals.css. This page documents the full mapping from token name to utility class.
How it works
Tailwind v4 replaces the old tailwind.config.js approach with a CSS-first configuration. The @theme inline block maps named CSS custom properties to Tailwind color names. Any property you define there becomes a Tailwind utility automatically.
/* globals.css — simplified excerpt */
@import "tailwindcss";
/* Semantic tokens defined in .dark selector */
.dark {
--background-default: hsl(0deg 0% 7.1%);
--brand-default: hsl(153.1deg 60.2% 52.7%);
}
/* @theme inline maps CSS vars → Tailwind utilities */
@theme inline {
--color-background: var(--background-default);
/* bg-background is now available */
--color-brand: var(--brand-default);
/* bg-brand, text-brand, border-brand are all available */
}Because the mapping is indirect (utility references a CSS var, which references another CSS var), swapping the entire theme at runtime is possible without touching the class names in JSX. The .dark selector changes the underlying values; the utilities stay the same.
Background utilities
| CSS variable | Tailwind class | Dark mode value |
|---|---|---|
--background-default | bg-background | hsl(0° 0% 7.1%) |
--background-surface-75 | bg-surface-75 | hsl(0° 0% 9%) |
--background-surface-100 | bg-surface-100 | hsl(0° 0% 12.2%) |
--background-surface-200 | bg-surface-200 | hsl(0° 0% 12.9%) |
--background-surface-300 | bg-surface-300 | hsl(0° 0% 16.1%) |
--background-surface-400 | bg-surface-400 | hsl(0° 0% 16.1%) |
--background-muted | bg-muted | hsl(0° 0% 14.1%) |
Foreground utilities
| CSS variable | Tailwind class | Dark mode value |
|---|---|---|
--foreground-default | text-foreground | hsl(0° 0% 98%) |
--foreground-light | text-foreground-light | hsl(0° 0% 70.6%) |
--foreground-lighter | text-foreground-lighter | hsl(0° 0% 53.7%) |
--foreground-muted | text-foreground-muted | hsl(0° 0% 30.2%) |
--foreground-contrast | text-foreground-contrast | hsl(0° 0% 8.6%) |
The text-* utilities also work as bg-* and border-* where the token is mapped. For example, --color-foreground enables text-foreground, bg-foreground, and border-foreground simultaneously.
Border utilities
| CSS variable | Tailwind class | Dark mode value |
|---|---|---|
--border-default | border-border | hsl(0° 0% 18%) |
--border-muted | border-border-muted | hsl(0° 0% 14.1%) |
--border-control | border-border-control | hsl(0° 0% 22.4%) |
--border-strong | border-border-strong | hsl(0° 0% 21.2%) |
--border-stronger | border-border-stronger | hsl(0° 0% 27.1%) |
--border-overlay | border-border-overlay | hsl(0° 0% 20%) |
Brand utilities
| CSS variable | Tailwind class | Dark mode value |
|---|---|---|
--brand-default | bg-brand / text-brand / border-brand | hsl(153.1° 60.2% 52.7%) |
--brand-200 | bg-brand-200 | hsl(162° 100% 2%) |
--brand-300 | bg-brand-300 / text-brand-300 | hsl(155.1° 100% 8%) |
--brand-400 | bg-brand-400 | hsl(155.5° 100% 9.6%) |
--brand-500 | bg-brand-500 | hsl(154.9° 100% 19.2%) |
--brand-600 | bg-brand-600 / text-brand-600 | hsl(154.9° 59.5% 70%) |
Shorthands and aliases
Some utility names are deliberately short for readability in dense component code. These aliases are defined in the @theme inline block alongside the full names.
| Shorthand class | Equivalent to | Notes |
|---|---|---|
bg-background | var(--background-default) | Main app canvas |
text-foreground | var(--foreground-default) | Primary text — drops the -default suffix |
border-border | var(--border-default) | Default border — the double "border" is intentional |
bg-muted | var(--background-muted) | Muted area fill |
text-muted-foreground | var(--foreground-muted) | shadcn/ui compat alias |
bg-brand | var(--brand-default) | Primary brand green |
bg-destructive | var(--destructive-default) | Primary red |
bg-warning | var(--warning-default) | Primary amber |
Opacity support
Because our tokens are exposed through @theme inline as color utilities, they support Tailwind's opacity modifier syntax out of the box. Use the slash notation to apply any opacity to any token-based color.
// Opacity modifier on any token-backed utility
<div className="bg-surface-300/90" /> // 90% opaque surface
<div className="bg-brand/10" /> // subtle brand tint
<div className="border-border/50" /> // half-opacity border
<div className="text-foreground/70" /> // slightly faded text
// Useful for focus rings
className="focus-visible:ring-2 focus-visible:ring-brand/40"
// Useful for overlay backgrounds
className="bg-black/60 backdrop-blur-sm" // modal backdropAdding a new token
To add a new design token and make it available as a Tailwind utility, follow these three steps in apps/[app]/app/globals.css:
/* Step 1: Define the primitive value in :root or .dark */
.dark {
--my-custom-token: hsl(200deg 80% 50%);
}
/* Step 2: Expose it in the @theme inline block */
@theme inline {
--color-custom: var(--my-custom-token);
}
/* Step 3: Use it in JSX */
// <div className="bg-custom text-custom border-custom" />Always define tokens in
@repo/ui/theme.cssif they should be shared across apps. App-specific overrides go in each app's ownglobals.css.