Skip to main content
Urbicon UI

Design Tokens

A comprehensive design token system built with CSS custom properties and Tailwind 4. Organized in semantic layers for consistent theming and easy customization.

Token Architecture

Foundation Layer

Base design decisions like colors, spacing, and typography scales.

Raw Values

Semantic Layer

Intent-based tokens that map foundation tokens to semantic meanings.

Contextual

Interaction Layer

Motion, shadow, and focus tokens for consistent animations and depth.

Motion & Depth

Foundation Colors

Loading...
Loading syntax highlighting...

Semantic Tokens

Loading...
Loading syntax highlighting...

Interaction Layer

Loading...
Loading syntax highlighting...

Color System

Neutral Palette

0
50
100
200
300
400
500
600
700
800
900
950

primary

--color-primary-50
--color-primary-500
--color-primary-900

success

--color-success-50
--color-success-500
--color-success-900

warning

--color-warning-50
--color-warning-500
--color-warning-900

danger

--color-danger-50
--color-danger-500
--color-danger-900

Spacing Scale

Urbicon UI does not ship a custom spacing token layer — it uses Tailwind's built-in spacing scale directly. Apply spacing with the standard utilities (p-4, gap-2, m-6). Each step is 0.25rem × n, driven by Tailwind's own --spacing variable.

UtilityValuePixelsVisual
p-0 / gap-000px
p-1 / gap-10.25rem4px
p-2 / gap-20.5rem8px
p-3 / gap-30.75rem12px
p-4 / gap-41rem16px
p-6 / gap-61.5rem24px
p-8 / gap-82rem32px
p-12 / gap-123rem48px

Typography Scale

Type sizes are Tailwind's built-in text-* utilities — there are no custom font-size CSS variables to import or override.

UtilityValuePixelsExample
text-xs0.75rem12pxThe quick brown fox
text-sm0.875rem14pxThe quick brown fox
text-base1rem16pxThe quick brown fox
text-lg1.125rem18pxThe quick brown fox
text-xl1.25rem20pxThe quick brown fox
text-2xl1.5rem24pxThe quick brown fox

Border Radius

Physical Scale

Real --radius-* CSS variables, each with a matching Tailwind utility.

rounded-xs
0.125rem
rounded-sm
0.25rem
rounded-md
0.375rem
rounded-lg
0.5rem
rounded-xl
0.75rem
rounded-2xl
1rem
rounded-3xl
1.5rem
rounded-4xl
2rem

Semantic Tiers

Components consume a 3-tier semantic vocabulary, not raw radii. Re-tint these three variables to reshape the whole library at once — see the Tier System for the full cascade.

TokenValueUsed by
--radius-commit9999pxPill/round — actions, identity, status (Button, Badge, Toggle)
--radius-modifyvar(--radius-sm) · 4pxEditable surfaces, navigation (Input, Select, Tab, Menu)
--radius-containvar(--radius-xs) · 2pxContainers, panels (Card, Alert, Dialog, Tooltip)

Motion & Depth

The interaction layer ships real --blocks-duration-* and --blocks-shadow-* variables (plus easing curves like --blocks-ease-gentle). Durations collapse to ~1ms under prefers-reduced-motion; shadows drop to none in high-contrast mode.

Duration tokenValue
--blocks-duration-instant75ms
--blocks-duration-fast150ms
--blocks-duration-normal250ms
--blocks-duration-slow350ms
--blocks-duration-slower500ms
--blocks-duration-slowest750ms
Shadow tokenSource
--blocks-shadow-xsvar(--color-shadow-xs)
--blocks-shadow-smvar(--color-shadow-sm)
--blocks-shadow-basevar(--color-shadow-base)
--blocks-shadow-mdvar(--color-shadow-md)
--blocks-shadow-lgvar(--color-shadow-lg)

Custom Theming

Use Tailwind 4's @theme directive to customize design tokens and create your own brand theme.

Custom Theme Example

Loading...
Loading syntax highlighting...

Theming Best Practices

  • Use semantic color names instead of specific color values
  • Test your theme in both light and dark modes
  • Ensure sufficient contrast ratios for accessibility
  • Consider using OKLCH color space for better perceptual uniformity
  • Keep your custom tokens organized and documented

Dark Mode Support

Design tokens automatically adapt to dark mode using light-dark(). No manual dark: overrides needed.

Light Mode Tokens

--color-surface-base neutral-0
--color-text-primary neutral-900

Dark Mode Tokens

--color-surface-base neutral-900
--color-text-primary neutral-50