Tailwind Design System

Use when: implement a design system in Tailwind with tokens, variants, and consistent components.

kimtth cc295d8 1.1 KB Updated

File contents

Goal: consistent, themeable UI without per-component drift.

Use for:

  • standardizing spacing, color, and typography across a project
  • building reusable components with controlled variants
  • replacing scattered ad hoc classes with a system

Workflow:

  1. Define tokens in the theme: color, spacing, radius, type scale.
  2. Drive components from tokens, not hard-coded values.
  3. Encode variants with a variants helper (e.g. cva).
  4. Centralize class composition; merge conflicts predictably.
  5. Support theming via CSS variables for light/dark.
  6. Document the allowed variants and when to use each.

Patterns:

  • semantic token names (bg-surface, text-muted) over raw scales
  • variant maps for size/intent/state
  • class-merge utility to resolve overrides
  • CSS variables for runtime theme switching

Rules:

  • no magic numbers; use the spacing and type scale
  • keep variants finite and intentional
  • avoid duplicating tokens across components
  • a new visual value belongs in the theme, not inline

kimtth/agent-skill-100-lines-or-less/tree/main/skills/tailwind-design-system commit cc295d8e10

Frequently asked questions

npx skillmds@latest add kimtth/tailwind-design-system