CursorTailwind CSSCode Style

Tailwind CSS Cursor Rules

Cursor rules for Tailwind CSS: class organization, component extraction, responsive design, and dark mode conventions.

.cursorrules
- Order classes: layout → sizing → spacing → typography → colors → effects
- Extract repeated utility patterns into components, not @apply directives
- Use the tailwind-merge (twMerge) utility to safely combine conditional classes
- Prefer responsive prefixes (sm:, md:, lg:) over custom breakpoints
- Use semantic color tokens in tailwind.config.ts (brand, surface, text) over raw colors
- Enable dark mode with class strategy; use dark: prefix consistently
- Use container queries (cq) for truly component-level responsive design
- Avoid inline style overrides; extend the theme for project-specific values

How to use with Cursor

Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.

#tailwind#css#styling#cursor#coding-rules

Related Rules