Skip to main content

Design Tokens

Core design tokens that power the Stacks Design System. Use these tokens to maintain consistency across your application.

CSS Custom Properties

All tokens are exposed as CSS custom properties (variables) for easy theming and customization.

Color Tokens

Color tokens define the visual palette of your application. The system supports both light and dark modes with semantically named tokens.

TokenLightDarkUsage
--backgroundoklch(0.99 0 0)oklch(0.13 0.01 45)Page background
--foregroundoklch(0.15 0 0)oklch(0.95 0 0)Primary text
--primaryoklch(0.7 0.18 45)oklch(0.72 0.19 45)Stacks orange
--secondaryoklch(0.96 0 0)oklch(0.25 0.02 45)Secondary surfaces
--mutedoklch(0.96 0.005 45)oklch(0.22 0.015 45)Muted elements
--accentoklch(0.97 0.02 45)oklch(0.25 0.03 45)Accent highlights
--destructiveoklch(0.6 0.22 25)oklch(0.65 0.2 25)Error/destructive
--borderoklch(0.9 0.01 45)oklch(0.28 0.02 45)Borders
--ringoklch(0.7 0.18 45)oklch(0.72 0.19 45)Focus rings

The Stacks Orange

The primary brand color is a warm orange (oklch(0.7 0.18 45)) that represents the Stacks ecosystem. This color is used for primary actions, links, and accent elements.

Spacing Scale

Consistent spacing creates rhythm and hierarchy. The spacing scale is based on a 4px base unit.

NameValuePixels
0.50.125rem2px
10.25rem4px
20.5rem8px
30.75rem12px
41rem16px
51.25rem20px
61.5rem24px
82rem32px
102.5rem40px
123rem48px
164rem64px

Border Radius

Border radius tokens control the roundness of elements. The base radius is configurable via --radius.

TokenValueUsage
--radius-smcalc(var(--radius) - 4px)Small elements
--radius-mdcalc(var(--radius) - 2px)Medium elements
--radius-lgvar(--radius)Large elements (default 0.5rem)
--radius-xlcalc(var(--radius) + 4px)Extra large
--radius-full9999pxPills and circles

Using Tokens in Code

Access tokens via CSS variables or Tailwind utilities:

/* CSS */
.my-element {
background-color: var(--primary);
padding: var(--spacing-4);
border-radius: var(--radius-lg);
}
{/* Tailwind */}
<div className="bg-primary p-4 rounded-lg">
Content
</div>