Design System Creation
Build comprehensive design systems for consistent UI development across teams.
Design System Layers
- Foundation: Colors, typography, spacing, elevation
- Components: Buttons, inputs, cards, navigation
- Patterns: Forms, layouts, empty states
Foundation - Design Tokens
:root {
/* Colors */
--color-primary-50: #eff6ff;
--color-primary-500: #3b82f6;
--color-primary-900: #1e3a8a;
/* Semantic colors */
--color-success: #22c55e;
--color-warning: #f59e0b;
--color-error: #ef4444;
/* Typography */
--font-sans: 'Inter', system-ui, sans-serif;
--font-mono: 'Fira Code', monospace;
/* Type scale */
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
/* Spacing (4px base) */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-4: 1rem;
--space-8: 2rem;
/* Elevation */
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
--shadow-md: 0 4px 6px rgba(0,0,0,0.1);
--shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}
Component Documentation
## Button
### Anatomy
- Container (padding, background)
- Label (text)
- Icon (optional)
### Variants
- Primary: Main actions
- Secondary: Alternative actions
- Ghost: Subtle actions
### States
- Default, Hover, Active, Disabled, Loading
### Accessibility
- Role: button
- Keyboard: Enter/Space to activate
- Focus: Visible focus ring
Component Example (React)
interface ButtonProps {
variant?: 'primary' | 'secondary' | 'ghost';
size?: 'sm' | 'md' | 'lg';
loading?: boolean;
disabled?: boolean;
children: React.ReactNode;
}
function Button({ variant = 'primary', size = 'md', loading, disabled, children }: ButtonProps) {
return (
<button
className={`btn btn-${variant} btn-${size}`}
disabled={disabled || loading}
aria-busy={loading}
>
{loading ? <Spinner /> : children}
</button>
);
}
Governance
- Review Committee: Approves new components
- Contribution Process: RFC → Review → Implementation
- Versioning: Semantic versioning for releases
- Deprecation: 3-month notice with migration guide
Best Practices
- Start with foundational tokens
- Document every component thoroughly
- Ensure WCAG 2.1 AA compliance
- Support dark mode from the start
- Include usage guidelines with do/don't examples
1---2name: design-system-creation3description: |4 Creates comprehensive design systems with typography, colors, components, and documentation for consistent UI development. Use when establishing design standards, building component libraries, or ensuring cross-team consistency.56 Keywords: design-tokens, typography, spacing, color-palette, components, patterns, variables, dark-mode, theming, CSS-variables, accessibility, WCAG, responsive, grid-system, breakpoints, design-scale, semantic-tokens, component-library, style-guide, documentation, Figma, Storybook, brand-consistency, design-principles7license: MIT8metadata:9 source: https://skillmd.com/skills/secondsky/design-system-creation10---1112# Design System Creation1314Build comprehensive design systems for consistent UI development across teams.1516## Design System Layers17181. **Foundation**: Colors, typography, spacing, elevation192. **Components**: Buttons, inputs, cards, navigation203. **Patterns**: Forms, layouts, empty states2122## Foundation - Design Tokens2324```css25:root {26 /* Colors */27 --color-primary-50: #eff6ff;28 --color-primary-500: #3b82f6;29 --color-primary-900: #1e3a8a;3031 /* Semantic colors */32 --color-success: #22c55e;33 --color-warning: #f59e0b;34 --color-error: #ef4444;3536 /* Typography */37 --font-sans: 'Inter', system-ui, sans-serif;38 --font-mono: 'Fira Code', monospace;3940 /* Type scale */41 --text-xs: 0.75rem;42 --text-sm: 0.875rem;43 --text-base: 1rem;44 --text-lg: 1.125rem;45 --text-xl: 1.25rem;46 --text-2xl: 1.5rem;4748 /* Spacing (4px base) */49 --space-1: 0.25rem;50 --space-2: 0.5rem;51 --space-4: 1rem;52 --space-8: 2rem;5354 /* Elevation */55 --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);56 --shadow-md: 0 4px 6px rgba(0,0,0,0.1);57 --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);58}59```6061## Component Documentation6263```markdown64## Button6566### Anatomy67- Container (padding, background)68- Label (text)69- Icon (optional)7071### Variants72- Primary: Main actions73- Secondary: Alternative actions74- Ghost: Subtle actions7576### States77- Default, Hover, Active, Disabled, Loading7879### Accessibility80- Role: button81- Keyboard: Enter/Space to activate82- Focus: Visible focus ring83```8485## Component Example (React)8687```tsx88interface ButtonProps {89 variant?: 'primary' | 'secondary' | 'ghost';90 size?: 'sm' | 'md' | 'lg';91 loading?: boolean;92 disabled?: boolean;93 children: React.ReactNode;94}9596function Button({ variant = 'primary', size = 'md', loading, disabled, children }: ButtonProps) {97 return (98 <button99 className={`btn btn-${variant} btn-${size}`}100 disabled={disabled || loading}101 aria-busy={loading}102 >103 {loading ? <Spinner /> : children}104 </button>105 );106}107```108109## Governance110111- **Review Committee**: Approves new components112- **Contribution Process**: RFC → Review → Implementation113- **Versioning**: Semantic versioning for releases114- **Deprecation**: 3-month notice with migration guide115116## Best Practices117118- Start with foundational tokens119- Document every component thoroughly120- Ensure WCAG 2.1 AA compliance121- Support dark mode from the start122- Include usage guidelines with do/don't examples