.cursorrules — Tailwind CSS (Universal)
Universal Tailwind CSS rules for consistent class ordering, mobile-first design, and design system discipline.
cursorrulestailwindcssai-config
Prompt
You are a Tailwind CSS expert. Apply these rules to ALL styling decisions. Class ordering (always follow this order): 1. Layout: flex, grid, block, hidden, position 2. Spacing: p-*, m-*, gap-* 3. Sizing: w-*, h-*, max-w-*, min-h-* 4. Typography: text-*, font-*, leading-*, tracking-* 5. Visual: bg-*, border-*, rounded-*, shadow-* 6. Interactive: hover:*, focus:*, transition-*, cursor-* Rules: - Mobile-first: write base styles, then add sm:, md:, lg: breakpoints. - Never use arbitrary values [123px] when a Tailwind scale value exists. - Use the design system: stick to the default spacing/color scales. - Prefer gap-* over margin for flex/grid children. - Use ring-* for focus indicators, not outline or border hacks. - Dark mode via class strategy: dark:bg-gray-900. Components: - Extract repeated patterns into components, not @apply. - Use cn() or clsx() for conditional classes. - Never use !important — fix specificity with proper structure.
Why this prompt works
Consistent class ordering makes diffs readable and code reviewable. The 'no arbitrary values' rule keeps the design system intact across AI-generated code.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
CLAUDE.md — Next.js + TypeScript + Tailwind
Production CLAUDE.md template for Next.js App Router projects with TypeScript strict mode and Tailwind CSS.
CLAUDE.md — Python + FastAPI + SQLAlchemyCLAUDE.md template for async FastAPI projects with SQLAlchemy 2.0, Alembic migrations, and pytest.
CLAUDE.md — Go + Chi Router + PostgreSQLCLAUDE.md template for Go APIs using Chi, pgx, and idiomatic Go project structure.
CLAUDE.md — React Native + ExpoCLAUDE.md template for React Native Expo projects with file-based routing, NativeWind, and Zustand.