| name | design-systems |
| description | This skill provides frameworks for building design systems that scale from single projects to entire organizations. Use when this capability is needed. |
| metadata | {"author":"frankxai"} |
name: Design System Architecture
description: Build consistent, scalable design systems with proper token architecture
version: 1.0.0
license: MIT
tier: community
Design System Architecture
Create consistent, scalable visual languages that evolve gracefully
This skill provides frameworks for building design systems that scale from single projects to entire organizations.
Core Principles
1. Tokens Are Truth
Design decisions should be encoded as tokens (variables). Nothing should be hard-coded.
2. Constraints Enable Creativity
A good design system provides guardrails that speed up decisions, not slow them down.
3. Components Over Compositions
Build primitives that compose into anything, not specific layouts that restrict.
Token Architecture
The Token Hierarchy
┌─────────────────────────────────────────────────────────────┐
│ SEMANTIC TOKENS │
│ (What they mean: --color-primary, --spacing-section) │
└────────────────────────────┬────────────────────────────────┘
│ Reference
▼
┌─────────────────────────────────────────────────────────────┐
│ ALIAS TOKENS │
│ (Design decisions: --color-brand-primary, --size-lg) │
└────────────────────────────┬────────────────────────────────┘
│ Reference
▼
┌─────────────────────────────────────────────────────────────┐
│ PRIMITIVE TOKENS │
│ (Raw values: --blue-500, --space-16, --font-inter) │
└─────────────────────────────────────────────────────────────┘
Primitive Tokens
Raw values with no semantic meaning.
--gray-50: #fafafa;
--gray-100: #f5f5f5;
--gray-200: #e5e5e5;
--gray-300: #d4d4d4;
--gray-400: #a3a3a3;
--gray-500: #737373;
--gray-600: #525252;
--gray-700: #404040;
--gray-800: #262626;
--gray-900: #171717;
--blue-50: #eff6ff;
--blue-100: #dbeafe;
--blue-200: #bfdbfe;
--blue-300: #93c5fd;
--blue-400: #60a5fa;
--blue-500: #3b82f6;
--blue-600: #2563eb;
--blue-700: #1d4ed8;
--blue-800: #1e40af;
--blue-900: #1e3a8a;
--space-0: 0;
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: system-ui, -apple-system, sans-serif;
: ui-monospace, monospace;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
Alias Tokens
Design decisions that reference primitives.
--color-brand-primary: var(--blue-600);
--color-brand-primary-hover: var(--blue-700);
--color-brand-secondary: var(--gray-600);
--size-xs: var(--space-2);
--size-sm: var(--space-3);
--size-md: var(--space-4);
--size-lg: var(--space-6);
--size-xl: var(--space-8);
--radius-none: 0;
--radius-sm: 0.125rem;
--radius-md: 0.375rem;
--radius-lg: 0.5rem;
--radius-xl: 0.75rem;
--radius-full: 9999px;
Semantic Tokens
Tokens that describe usage, not values.
--color-bg-primary: var(--white);
--color-bg-secondary: var(--gray-50);
--color-bg-tertiary: var(--gray-100);
--color-bg-inverse: var(--gray-900);
--color-text-primary: var(--gray-900);
--color-text-secondary: var(--gray-600);
--color-text-tertiary: var(--gray-400);
--color-text-inverse: var(--white);
--color-text-link: var(--color-brand-primary);
--color-border-default: var(--gray-200);
--color-border-strong: var(--gray-300);
--color-border-focus: var(--color-brand-primary);
--color-success: var(--green-600);
--color-warning: var(--yellow-500);
--color-error: var(--red-600);
--color-info: var(--blue-600);
--button-padding-x: var(--space-4);
: (--space-);
: (--radius-md);
: (--weight-medium);
: (--space-);
: ;
: (--radius-md);
: (--space-);
: (--radius-lg);
: (,,,);
Color System
Building a Color Palette
Color Palette Structure:
Neutrals:
Purpose: Text, backgrounds, borders
Scale: 50-900 (10 shades minimum)
Key values:
- 50: Subtle backgrounds
- 100-200: Secondary backgrounds
- 400-500: Placeholder text
- 600-700: Secondary text
- 800-900: Primary text
Brand Primary:
Purpose: CTAs, links, key actions
Scale: 50-900
Key values:
- 500-600: Main brand color
- 600-700: Hover states
- 100-200: Light backgrounds
Brand Secondary:
Dark Mode Strategy
:root {
--color-bg-primary: var(--white);
--color-bg-secondary: var(--gray-50);
--color-text-primary: var(--gray-900);
--color-text-secondary: var(--gray-600);
--color-border-default: var(--gray-200);
}
[data-theme="dark"] {
--color-bg-primary: var(--gray-900);
--color-bg-secondary: var(--gray-800);
--color-text-primary: var(--gray-50);
--color-text-secondary: var(--gray-400);
--color-border-default: var(--gray-700);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--color-bg-primary: var(--gray-900);
}
}
Typography System
Type Scale
Typography Scale:
Display:
- display-2xl: 4.5rem/1.1 (72px) - Hero headlines
- display-xl: 3.75rem/1.1 (60px) - Major headings
- display-lg: 3rem/1.1 (48px) - Section headlines
Headings:
- heading-xl: 2.25rem/1.25 (36px) - Page titles
- heading-lg: 1.875rem/1.3 (30px) - Section titles
- heading-md: 1.5rem/1.35 (24px) - Subsections
- heading-sm: 1.25rem/1.4 (20px) - Card titles
- heading-xs:
Implementing Type Scale
.text-display-2xl {
font-size: var(--text-5xl);
line-height: 1.1;
font-weight: var(--weight-bold);
letter-spacing: -0.02em;
}
.text-heading-xl {
font-size: var(--text-4xl);
line-height: 1.25;
font-weight: var(--weight-semibold);
letter-spacing: -0.01em;
}
.text-body-md {
font-size: var(--text-base);
line-height: 1.6;
font-weight: var(--weight-normal);
}
Spacing System
Spacing Scale Philosophy
Spacing Philosophy:
Base Unit: 4px (0.25rem)
Scale Type: Geometric with adjustments
Common uses:
- 4px (space-1): Icon gaps, tight spacing
- 8px (space-2): Inline elements, button padding (y)
- 12px (space-3): Form inputs padding
- 16px (space-4): Component padding, button padding (x)
- 24px (space-6): Card padding, section gaps
- 32px (space-8): Related section spacing
- 48px (space-12): Unrelated section spacing
- 64px (space-16): Major page sections
- 96px (space-24):
Spacing Usage Guidelines
Component Spacing:
Buttons:
Padding: space-2 space-4 (8px 16px)
Gap between: space-2 (8px)
Cards:
Padding: space-6 (24px)
Gap between: space-6 (24px)
Internal gaps: space-4 (16px)
Forms:
Input padding: space-3 (12px)
Label to input: space-2 (8px)
Between fields: space-6 (24px)
Lists:
Item padding: space-3 space-4
Between items: space-1 or space-2
Page Spacing:
Section padding: space-16 to space-24 (64-96px)
Content width: max 80ch for prose
Grid gaps: space-6 to space-8
Component Architecture
Component Anatomy
Component Anatomy:
Button Example:
Container:
- Background color (semantic)
- Border radius (from scale)
- Border (optional)
- Padding (from scale)
- Min height/width
Content:
- Text color (semantic)
- Font size (from scale)
- Font weight (from scale)
- Line height
- Letter spacing
Icon (optional):
- Size (proportional)
- Color (inherit or specific)
- Spacing from text
States:
Component Variants Pattern
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
padding: var(--button-padding-y) var(--button-padding-x);
border-radius: var(--button-radius);
font-weight: var(--button-font-weight);
transition: all 150ms ease;
}
.btn-primary {
background: var(--color-brand-primary);
color: var(--color-text-inverse);
}
.btn-primary:hover {
background: var(--color-brand-primary-hover);
}
.btn-secondary {
background: transparent;
border: 1px solid var(--color-border-default);
color: var(--color-text-primary);
}
.btn-ghost {
background: transparent;
color: var(--color-text-primary);
}
.btn-sm {
padding: var(--space-1) var(--space-3);
font-size: var(--text-sm);
}
.btn-lg {
: (--space-) (--space-);
: (--text-lg);
}
Tailwind Integration
Custom Tailwind Config
module.exports = {
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
gray: {
50: 'var(--gray-50)',
100: 'var(--gray-100)',
},
bg: {
primary: 'var(--color-bg-primary)',
secondary: 'var(--color-bg-secondary)',
tertiary: 'var(--color-bg-tertiary)',
},
text: {
primary: 'var(--color-text-primary)',
secondary: 'var(--color-text-secondary)',
},
border: {
DEFAULT: 'var(--color-border-default)',
strong: 'var(--color-border-strong)',
},
},
spacing: {
0: 'var(--space-0)',
1: 'var(--space-1)',
2: 'var(--space-2)',
},
borderRadius: {
none: 'var(--radius-none)',
sm: 'var(--radius-sm)',
: ,
: ,
: ,
},
: {
: [, { : }],
: [, { : }],
: [, { : }],
},
},
}
Animation System
Animation Tokens
--duration-instant: 0ms;
--duration-fast: 100ms;
--duration-normal: 200ms;
--duration-slow: 300ms;
--duration-slower: 500ms;
--ease-linear: linear;
--ease-in: cubic-bezier(0.4, 0, 1, 1);
--ease-out: cubic-bezier(0, 0, 0.2, 1);
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
--ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
Common Animation Patterns
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slide-up {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes scale-in {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
.animate-fade-in {
animation: fade-in var(--duration-normal) var(--ease-out);
}
.animate-slide-up {
animation: slide-up var(--duration-normal) var(--ease-out);
}
Quality Checklist
Design System Audit
"A design system is not a project. It's a product, serving products."
Converted and distributed by TomeVault — claim your Tome and manage your conversions.