InstructionsForAI
tailwind-css-conventions.mdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---description: "Use when styling components with Tailwind CSS"alwaysApply: false--- ## Tailwind CSS Guidelines ### Class Organization Order classes logically:1. Layout (flex, grid, position)2. Sizing (w, h, p, m)3. Typography (text, font)4. Colors (bg, text, border)5. Effects (shadow, opacity)6. Transitions ```tsx// ✅ Organized<div className="flex items-center gap-4 p-4 text-sm text-muted-foreground bg-muted rounded-lg shadow-sm transition-colors"> // ❌ Unorganized <div className="shadow-sm text-sm p-4 flex bg-muted rounded-lg gap-4 items-center">``` ### Use cn() for Conditional Classes ```tsximport { cn } from "@/lib/utils"; <button className={cn( "px-4 py-2 rounded-md font-medium", isActive && "bg-primary text-primary-foreground", isDisabled && "opacity-50 cursor-not-allowed")}>``` ### Responsive Design Mobile-first approach with breakpoint prefixes: ```tsx<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">``` ### Dark Mode Use CSS variables from the design system, not hardcoded colors: ```tsx// ✅ Good - uses CSS variables<div className="bg-background text-foreground border-border"> // ❌ Bad - hardcoded colors<div className="bg-white text-black dark:bg-gray-900 dark:text-white">```
MDC (Frontmatter)Markdown