Skip to main content
Version: latest

Design Tokens

All design decisions in prokodo UI are expressed as CSS custom properties under the --pk-* namespace. The system has three layers:

  1. Primitive palette (--pk-palette-*) — Raw hex values; do not reference these directly in consumer code
  2. Semantic tokens (--pk-color-*, --pk-space-*, --pk-radius-*, …) — Role-based aliases
  3. Component tokens (--pk-input-*, --pk-select-*, …) — Per-component override points

Import global token definitions once in your app root:

import "@prokodo/ui/theme-tokens.css"
tip

theme-tokens.css contains only shared --pk-* custom properties (palette + semantic layers) — no component styles. This keeps your critical CSS path small. Component styles are loaded per component via their own CSS files (e.g. @prokodo/ui/button.css), and those files provide each component's --pk-<component>-* tokens. See Installation for details.


Colour

Brand

TokenDefaultUsage
--pk-color-primary#6366f1Primary actions, focus rings
--pk-color-primary-100#e0e7ffLight primary tint
--pk-color-primary-500#6366f1Base primary
--pk-color-primary-900#312e81Dark primary shade
--pk-color-secondary#ec4899Secondary actions

Semantic

TokenDefaultUsage
--pk-color-success#22c55eSuccess states
--pk-color-warning#f59e0bWarning states
--pk-color-error#ef4444Error states
--pk-color-info#3b82f6Informational states

Surface

TokenDefaultUsage
--pk-color-background#ffffffPage background
--pk-color-surface#f9fafbCard / panel background
--pk-color-border#e5e7ebDividers, input borders
--pk-color-text#111827Body text
--pk-color-text-muted#4d4d4dSecondary text

Typography

TokenDefaultUsage
--pk-font-family-basesystem-ui, sans-serifBody text
--pk-font-family-headinginheritHeading elements
--pk-font-family-monoui-monospace, monospaceCode blocks
--pk-font-size-base1remBody font size
--pk-font-size-sm0.875remSmall text
--pk-font-size-lg1.125remLarge text
--pk-font-weight-normal400Regular weight
--pk-font-weight-medium500Medium weight
--pk-font-weight-bold700Bold weight
--pk-line-height-base1.5Body line height
--pk-line-height-tight1.25Heading line height

Spacing

Prokodo UI uses a 4 px base grid:

TokenValue
--pk-spacing-14px
--pk-spacing-28px
--pk-spacing-312px
--pk-spacing-416px
--pk-spacing-624px
--pk-spacing-832px
--pk-spacing-1248px
--pk-spacing-1664px

Border radius

TokenDefaultUsage
--pk-radius-sm4pxChips, tags
--pk-radius-md8pxInputs, cards
--pk-radius-lg16pxDialogs, popovers
--pk-radius-full9999pxPills, toggle switches

Shadows

TokenDefault
--pk-shadow-sm0 1px 2px rgba(0,0,0,.06)
--pk-shadow-md0 4px 12px rgba(0,0,0,.10)
--pk-shadow-lg0 12px 40px rgba(0,0,0,.15)

Motion

TokenDefaultUsage
--pk-duration-fast150msHover, focus transitions
--pk-duration-base250msComponent state changes
--pk-duration-slow400msEntrance animations
--pk-easing-basecubic-bezier(.4,0,.2,1)Standard easing
--pk-easing-entercubic-bezier(0,0,.2,1)Decelerate on enter
--pk-easing-exitcubic-bezier(.4,0,1,1)Accelerate on exit

Z-Index

TokenDefaultUsage
--pk-z-header2Sticky page header
--pk-z-nav999Main navigation overlay
--pk-z-dropdown998Dropdowns / menus
--pk-z-modal-backdrop1300Modal backdrop layer
--pk-z-modal1301Modal dialog
--pk-z-popover1400Popovers above modals (DatePicker, Select, Tooltip)

Overriding tokens

app/globals.css
@import "@prokodo/ui/theme-tokens.css";

:root {
--pk-color-primary: #0ea5e9;
--pk-radius-md: 4px; /* sharper corners */
--pk-font-family-base: "DM Sans", sans-serif;
}

See Theming for patterns including dark mode and scoped overrides.