Skip to content

design-system

Use when architecting design tokens, setting up CSS custom properties, organizing theme systems, debugging CSS specificity issues, or establishing component API patterns. Also use for CSS architecture decisions (Tailwind vs Modules vs Vanilla Extract) and token layer organization.

ModelSource
sonnetpack: frontend
Full Reference

The structural and technical architecture of design systems — token layers, CSS architecture decisions, theming strategies, component API patterns, and CSS debugging. The “how” to ui-craft’s “what.” Where ui-craft answers “what should this look like,” design-system answers “how should it be organized and maintained.”

┏━ 🎨 design-system ━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ [one-line description of design system task] ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ItemValue
Token modelThree layers: Primitive → Semantic → Component
Default CSS approachTailwind v4 with @theme CSS custom properties
RSC safe approachesTailwind v4, CSS Modules, Vanilla Extract, Panda CSS
Avoid for RSCEmotion, styled-components (runtime overhead)
Component variant toolcva (class-variance-authority) + cn() utility
Specificity fixCSS @layer ordering beats specificity fights
Extend vs replaceAlways extend existing tokens before creating new files

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

I want to…File
Set up the three-layer token model (primitive/semantic/component)reference/token-architecture.md
Choose between Tailwind, CSS Modules, Vanilla Extract, Panda CSSreference/css-architecture.md
Implement dark mode, light mode, or multi-brand themingreference/theming.md
Build component APIs with cva, cn(), and compound patternsreference/component-api.md
Debug z-index, overflow, specificity, layout shift, or spacing issuesreference/css-debugging.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

SkillRelationship
ui-craftui-craft defines WHAT it looks like, design-system defines HOW it’s structured
tailwind-cssdesign-system defines tokens, Tailwind consumes them via @theme
shadcn-uishadcn uses CSS variables that follow this three-layer token architecture
brandbrand.json values become primitive tokens; never hardcode brand colors
nap-ninjasame centralization principle — source of truth over duplication