Skip to Content
Theme

Theme

Chunks UI uses a CSS variable-based design token system following the shadcn/ui  naming convention. All colors are defined in the OKLCH color space for perceptual uniformity.

Setup

Import the theme CSS in your app entry point:

import "chunks-ui/theme.css";

This single file provides all CSS variables for light mode, dark mode, and Tailwind v4 @theme inline tokens.

Color System

Semantic Colors (OKLCH)

TokenLight ValuePurpose
--primaryoklch(60.48% 0.2165 257.21)Brand blue
--primary-foregroundoklch(0.985 0 0)Text on primary
--successoklch(75.14% 0.1514 166.5)Positive actions
--success-foregroundoklch(0.985 0 0)Text on success
--warningoklch(77.97% 0.1665 72.45)Caution states
--warning-foregroundoklch(0.145 0 0)Text on warning
--destructiveoklch(66.16% 0.2249 25.88)Errors, deletions
--destructive-foregroundoklch(0.985 0 0)Text on destructive

Surface Colors

TokenLightDark
--backgroundoklch(1 0 0)oklch(0.145 0 0)
--foregroundoklch(0.145 0 0)oklch(0.985 0 0)
--cardoklch(1 0 0)oklch(0.145 0 0)
--card-foregroundoklch(0.145 0 0)oklch(0.985 0 0)
--popoveroklch(1 0 0)oklch(0.145 0 0)
--popover-foregroundoklch(0.145 0 0)oklch(0.985 0 0)

Neutral Palette

TokenLightDark
--secondaryoklch(0.97 0 0)oklch(0.269 0 0)
--secondary-foregroundoklch(0.205 0 0)oklch(0.985 0 0)
--mutedoklch(0.97 0 0)oklch(0.269 0 0)
--muted-foregroundoklch(0.556 0 0)oklch(0.708 0 0)
--accentoklch(0.97 0 0)oklch(0.269 0 0)
--accent-foregroundoklch(0.205 0 0)oklch(0.985 0 0)

Utility Tokens

TokenLightDark
--borderoklch(0.922 0 0)oklch(0.269 0 0)
--inputoklch(0.922 0 0)oklch(0.269 0 0)
--ringoklch(0.708 0 0)oklch(0.556 0 0)
--radius0.625rem0.625rem

Tailwind Usage

Variables are mapped to Tailwind utilities via @theme inline:

@theme inline { --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-success: var(--success); --color-destructive: var(--destructive); /* ... */ }

This means you can use them directly in Tailwind classes:

<div className="bg-primary text-primary-foreground" /> <div className="bg-destructive text-destructive-foreground" /> <div className="border-border text-muted-foreground" />

Dark Mode

Dark mode is toggled by adding the .dark class to the <html> element (same convention as shadcn/ui). The same variable names are redefined with dark values:

.dark { --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0); --primary: oklch(60.48% 0.2165 257.21); /* ... */ }

Components automatically adapt — no extra props needed.

Typography

TokenValue
--font-sans"Manrope", sans-serif
--font-mono"Fira Code", monospace

Use in Tailwind: font-sans, font-mono.

Easing Curves

TokenValueUse case
--ease-fluidcubic-bezier(0.3, 0, 0, 1)General transitions
--ease-snappycubic-bezier(0.2, 0, 0, 1)Quick, responsive motion

Use in Tailwind: ease-fluid, ease-snappy.

Component Sizing

TokenValue
--spacing-ui-height35px
--spacing-ui-icon-heightcalc(var(--spacing-ui-height) * 0.5)

Z-Index Layers

The z-index system provides ordered layers to prevent stacking conflicts:

TokenValueUse case
--z-base0Default content
--z-dropdowns200Select popups, menus
--z-tooltips400Tooltip overlays
--z-overlays500General overlays
--z-drawers600Side/bottom drawers
--z-modals700Modal dialogs
--z-notifications800Toast notifications

Border Radius

TokenValue
--radius-smcalc(var(--radius) - 4px)
--radius-mdcalc(var(--radius) - 2px)
--radius-lgvar(--radius) (0.625rem)
--radius-xlcalc(var(--radius) + 4px)

Chart Colors

Five chart colors are provided for data visualization, compatible with shadcn/ui charting:

--chart-1: oklch(0.646 0.222 41.116); --chart-2: oklch(0.6 0.118 184.704); --chart-3: oklch(0.398 0.07 227.392); --chart-4: oklch(0.828 0.189 84.429); --chart-5: oklch(0.769 0.188 70.08);

Customization

To override tokens, redefine the CSS variables after importing the theme:

@import "chunks-ui/theme.css"; :root { --primary: oklch(70% 0.2 150); --radius: 0.5rem; }

All components will pick up the new values automatically.

Last updated on