# Tailwind CSS Best Practices - Agent Guide This skill provides comprehensive Tailwind CSS patterns and best practices for AI coding agents. ## Skill Overview **Name:** tailwind-best-practices **Version:** 1.0.0 **Framework:** Tailwind CSS v3.4+ / v4.0+ **Rule Count:** 29 rules across 8 categories **License:** MIT ## When to Use This Skill Activate this skill when: - Writing or refactoring Tailwind CSS classes - Implementing responsive designs with breakpoints - Adding dark mode support to applications - Creating reusable component patterns - Configuring Tailwind theme customization (v3 config or v4 @theme) - Migrating from Tailwind v3 to v4 - Building forms, buttons, cards, tables, navigation - Optimizing Tailwind for production - Questions about Tailwind utilities and patterns ## Rule Categories ### 1. Responsive Design (CRITICAL - 6 rules) Mobile-first responsive patterns are fundamental to every Tailwind project. **Key Concepts:** - Mobile-first: Base styles apply to all screens, add breakpoints upward - Breakpoint order: `sm:` (640px) → `md:` (768px) → `lg:` (1024px) → `xl:` (1280px) → `2xl:` (1536px) - Container queries for component-scoped responsiveness - Fluid typography with `clamp()` for smooth scaling - Responsive grid systems with `grid-cols-{n}` **Common Patterns:** ```html
``` ### Interactive States ```html