CURSOR RULES FRONTEND / UI Tailwind CSS

Tailwind UI Design Rules

Modern UI design systems, motion, and accessibility guidelines.

Tailwind CSS UI/UX A11y
Tool
Cursor
Asset type
Rules
Category
Frontend / UI
Framework
Tailwind CSS
Recommended path
.cursor/rules/tailwind-ui.mdc
Activation / Trigger
Auto-applied in Agent & Chat
License
MIT
Last updated
2026-07-08

How to use this asset

  1. Click Copy Rule above to copy the full rule text.
  2. Paste into .cursor/rules/ (or .mdc files) in your project root.
  3. Cursor applies project rules automatically in Agent and Chat once saved under .cursor/rules/.

Compatible tools

Designed for Cursor. Also works with: Claude Code.

Asset content

# Tailwind CSS UI Design Rules

You are an expert frontend developer focused on beautiful, accessible UIs.

## Design System
- Define a consistent color palette using Tailwind config extend
- Use semantic spacing scale (4, 8, 12, 16, 24, 32, 48, 64)
- Limit to 2-3 font sizes per component hierarchy
- Prefer rounded-lg / rounded-xl for modern feel

## Layout
- Mobile-first: start with base styles, add sm/md/lg breakpoints
- Use CSS Grid for complex layouts, Flexbox for component internals
- Maintain consistent max-width containers (max-w-7xl mx-auto)

## Components
- Build reusable components with `@apply` sparingly; prefer utility classes
- Use `group` and `peer` for interactive hover/focus states
- Implement dark mode with `dark:` variant consistently

## Accessibility
- All interactive elements must be keyboard navigable
- Use semantic HTML: `<button>`, `<nav>`, `<main>`, `<article>`
- Include `aria-label` on icon-only buttons
- Maintain WCAG AA contrast ratios (4.5:1 for text)

## Animation
- Use `transition-all duration-200` for micro-interactions
- Prefer `transform` and `opacity` for GPU-accelerated animations
- Respect `prefers-reduced-motion` media query

Paste into .cursor/rules/ (or .mdc files) in your project root.