Theming

Every color, size, shadow and easing is a design token: a CSS variable you can override in your global CSS.

What gets installed

The first Lanzate component that needs tokens also installs lanzate-theme. It adds Lanzate's variables to your global CSS and maps them for Tailwind, so utilities like bg-info, text-display and shadow-elevated work. It doesn't touch shadcn's standard variables (--background, --border…), except --primary.

:root {
  --primary: oklch(0.575 0.18 35);
  --primary-foreground: oklch(1 0 0);
  --primary-text: oklch(0.50 0.18 35);
  --error: oklch(0.577 0.245 27.325);
  --error-foreground: oklch(1 0 0);
  --error-text: oklch(0.46 0.245 27.325);
  --info: oklch(0.555 0.15 240);
  --info-foreground: oklch(1 0 0);
  --info-text: oklch(0.47 0.15 240);
  --warning: oklch(0.70 0.15 85);
  --warning-foreground: oklch(0 0 0);
  --warning-text: oklch(0.485 0.15 85);
  --success: oklch(0.55 0.15 142);
  --success-foreground: oklch(1 0 0);
  --success-text: oklch(0.47 0.15 142);
  --secondary-text: oklch(0.205 0 0);
  --muted-text: oklch(0.49 0 0);
}

.dark {
  --primary: oklch(0.66 0.18 35);
  --primary-foreground: oklch(0.145 0 0);
  --primary-text: oklch(0.74 0.18 35);
  --error: oklch(0.704 0.191 22.216);
  --error-text: oklch(0.765 0.191 22.216);
  --info: oklch(0.70 0.15 240);
  --warning: oklch(0.75 0.14 85);
  --success: oklch(0.65 0.14 142);
  --success-text: oklch(0.70 0.14 142);
  /* …the rest follow the same pattern */
}

Intent colors

Components' color prop takes an intent: primary, secondary, muted, info, warning, success or error. Each intent has two partners, so contrast is decided once, in the tokens:

  • -foreground is text on a solid fill, like a solid Button's label.
  • -text is text, icons and borders in the intent's color on the page or on its own light tint, like a soft Badge or Text color="info". It's darker than the fill in light mode and lighter in dark, so it stays readable (4.5:1) where the fill color wouldn't.

Use text-info-text for colored text in your own components, and keep bg-info for fills.

Fluid typography

The type scale uses clamp(), so text grows with the viewport without breakpoints.

@theme inline {
  --text-xs: clamp(0.75rem, calc(0.708rem + 0.208vw), 0.875rem);
  --text-sm: clamp(0.875rem, calc(0.833rem + 0.208vw), 1rem);
  --text-base: clamp(1rem, calc(0.958rem + 0.208vw), 1.125rem);
  --text-lg: clamp(1.125rem, calc(1.042rem + 0.417vw), 1.375rem);
  --text-xl: clamp(1.25rem, calc(1.125rem + 0.625vw), 1.625rem);
  --text-2xl: clamp(1.5rem, calc(1.25rem + 1.25vw), 2.25rem);
  --text-display: clamp(2rem, calc(1.417rem + 2.917vw), 3.75rem);
}

Customize colors

Override any token after the installed ones. For example, a blue primary:

:root {
  --primary: oklch(0.55 0.2 240);
  --primary-foreground: oklch(1 0 0);
  --primary-text: oklch(0.47 0.2 240);
}

Override an intent's -foreground and -text with it. Check contrast after a change: text needs 4.5:1 against what's behind it, including -text on a 15% tint of itself.

Merging classes

Lanzate components merge their classes with their own cn() (lib/cn.ts, installed by lanzate-utils), which knows the token class names. shadcn's stock cn() in lib/utils.ts doesn't: it reads text-display as a color and drops it next to text-primary.

Your lib/utils.ts is left as it is. If your own components use Lanzate's token classes, re-export Lanzate's cn() from it:

// lib/utils.ts
export { cn } from "@/lib/cn"

Dark mode

Dark mode is on when the .dark class is on <html>. The same tokens switch values; components need no changes.