web-styling-tailwind
Tailwind CSS v4+ Patterns
Quick Guide: Tailwind CSS v4 uses CSS-first configuration with
@import "tailwindcss"and@themedirective (NOTtailwind.config.js). Define design tokens as CSS variables in@theme, create custom utilities with@utility, custom variants with@custom-variant. Automatic content detection (nocontentarray). Use@tailwindcss/vitefor Vite,@tailwindcss/webpackfor Webpack. All colors use oklch. v4.1 adds text shadows, masks, and input-device variants. No Sass/Less/Stylus support.
Detailed Resources:
- For code examples, see examples/ folder:
- core.md - Setup, source detection, responsive design, dark mode, state variants, theme customization
- advanced.md - Custom utilities, custom variants, container queries, 3D transforms, text shadows, masks, input-device targeting, animations, component extraction
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST use @import "tailwindcss" and @theme for configuration - NEVER use tailwind.config.js, @tailwind base, or module.exports)