Design Tokens
Design tokens in DESIGN.md define exact visual primitives under five core groups: colors, typography, rounded, spacing, and motion.
Colors
colors maps semantic token names to any valid CSS color (#RRGGBB, #RGB, #RRGGBBAA, rgb(), oklch(), named CSS colors, or color-mix()):
colors:
primary: "#4338ca"
on-primary: "#ffffff"
background: "#ffffff"
surface: "#f6f5f4"
text: "#18181b"
text-muted: "#52525b"
border: "#e5e3df"DesignMD Pro’s parser computes WCAG relative luminance for hex colors (#RGB, #RGBA, #RRGGBB, #RRGGBBAA) to run automated foreground/background contrast checks. Non-hex CSS color values are preserved as literal strings with a parser warning.
Typography
typography maps style names to structured type properties:
| Property | Type / Values | Example |
|---|---|---|
fontFamily | Font stack or primary family name | "Inter, sans-serif" |
fontSize | CSS dimension (px, rem, em) | 16px |
fontWeight | Numeric weight (100–900) | 600 |
lineHeight | Unitless ratio or CSS dimension | 1.5 or 24px |
letterSpacing | CSS dimension (em, px, rem) | -0.02em |
fontFeature | CSS font-feature-settings value | "tnum" 1 |
fontVariation | CSS font-variation-settings value | "opsz" 32 |
typography:
headline-display:
fontFamily: Inter
fontSize: 40px
fontWeight: 600
lineHeight: 1.15
letterSpacing: -0.02em
body-md:
fontFamily: Inter
fontSize: 16px
fontWeight: 400
lineHeight: 1.6
code-sm:
fontFamily: JetBrains Mono
fontSize: 13px
fontWeight: 400
lineHeight: 1.5Rounded & Spacing
Both rounded and spacing map token names to CSS dimensions (px, em, rem); spacing also accepts unitless numbers for column counts or aspect ratios.
rounded:
sm: 4px
md: 8px
lg: 12px
full: 9999px
spacing:
xs: 4px
sm: 8px
md: 16px
lg: 24px
xl: 48pxMotion
motion maps purpose-named transition keys to duration, delay, and timingFunction:
motion:
hover-quick:
duration: 150ms
timingFunction: cubic-bezier(0.2, 0, 0, 1)
drawer-enter:
duration: 240ms
delay: 0ms
timingFunction: ease-outNested groups (themes and breakpoints)
Every token category except components supports nested sub-maps for themes and responsive breakpoints. Recommended group keys are light/dark for color modes and sm/md/lg/xl for breakpoints:
colors:
primary: "#4338ca"
background: "#ffffff"
text: "#18181b"
dark:
primary: "#818cf8"
background: "#0f172a"
text: "#f8fafc"DesignMD Pro’s code generators (Tailwind v4, CSS Variables, shadcn/ui, and v0 Prompt Generator) recognize light.* as default tokens and emit dark.* keys inside a .dark selector block.
Token references ({token})
Tokens can reference other tokens using curly-brace dot paths such as {colors.primary} or {rounded.md}:
- Outside
components, references must resolve to a primitive leaf value (for example{colors.primary}, not a whole group). - Inside
components, references may point either to primitive values or to composite tokens such as{typography.body-md}. - References may also appear embedded inside larger strings (such as
"1px solid {colors.border}"). - Circular reference chains (
a -> b -> a) are rejected by the validator (circular-ref).
Next steps
- Components — use
{token}references inside component definitions - Token Naming — semantic naming patterns compatible with automated contrast checks and shadcn mapping
- Tailwind CSS & shadcn/ui Integration — how DesignMD Pro compiles tokens into stylesheets