CursorCSSCode Style

CSS Cursor Rules

Cursor rules for CSS: custom properties, logical properties, modern layout, and maintainable CSS architecture.

.cursorrules
- Use CSS custom properties for all design tokens (colors, spacing, typography)
- Use logical properties (margin-inline, padding-block) for RTL support
- Use CSS Grid for two-dimensional layouts; Flexbox for one-dimensional
- Avoid deep selector nesting; keep specificity flat and predictable
- Use :is() and :where() to group selectors and control specificity
- Use clamp() for fluid typography and spacing (clamp(1rem, 2.5vw, 1.5rem))
- Prefer CSS animations over JavaScript for visual-only transitions
- Use container queries for component-level responsive design

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.

#css#styling#custom-properties#cursor#coding-rules

Related Rules