What problem does it solve?
Modern frontend teams struggle to keep Tailwind-based codebases consistent, accessible, and safe during migrations to Tailwind v4. This Skill provides clear conventions and actionable rules to avoid common pitfalls (dynamic class purging, inconsistent spacing, fragile dark-mode handling) and to adopt CSS-first configuration, semantic tokens, and robust component patterns.
Core Features & Use Cases
- Migration guidance: move tailwind.config.js into @theme CSS blocks, replace @tailwind with @import "tailwindcss", and apply v4 opacity and utility directives.
- Class management & component patterns: use cn() (twMerge + clsx) for merges, cva() for component variants, avoid @apply for component styling, and prefer tailwind-variants for slot-based components.
- Design tokens & color system: define OKLCH tokens in @theme, clear defaults with --color-*: initial, use color-mix(in oklab) for translucent variants, and override tokens in .dark for theme toggles.
- Responsive, accessibility & performance rules: mobile-first breakpoints, container queries for components, focus rings, 44x44 touch targets, motion-reduce support, and GPU-only animations (transform/opacity).
- Build & tooling: prefer @tailwindcss/vite or @tailwindcss/postcss for v4 integration, use @plugin/@utility/@custom-variant directives instead of legacy config arrays, and avoid scanning node_modules.
Quick Start
Audit your project for tailwind v3 patterns, convert theme values into a CSS @theme block using OKLCH tokens, replace @tailwind directives with @import "tailwindcss", and apply cn()/cva() patterns while ensuring accessibility and motion-reduce support.