Style Cleanup
Remove inline typography styles from shadcnblocks sections and fix heading hierarchy.
Workflow
- Read Component - Load the section component file
- Remove Typography Classes - Strip inline styles from h1-h6
- Check Heading Hierarchy - Verify proper h1 > h2 > h3 order
- Fix Hierarchy Issues - Adjust heading levels if needed
- Verify Single H1 - Ensure only one h1 per page
Classes to REMOVE from h1-h6
See references/cleanup-rules.md for complete list.
Typography sizes:
- text-4xl, text-5xl, text-6xl, text-7xl
- text-3xl, text-2xl, text-xl, text-lg
- uppercase, lowercase, capitalize
Font weights:
- font-bold, font-semibold, font-medium, font-light
Letter spacing:
- tracking-tight, tracking-wide, tracking-normal, tracking-tighter
Line height:
- leading-tight, leading-snug, leading-normal, leading-relaxed
Text colors on headings:
- bg-muted-foreground (when used with bg-clip-text)
Button styles:
- Any custom button style which is not from the component
- e.g., bg-, text-, p-, m- on buttons
Border-Radius Classes to REMOVE
Remove from MOST elements (div, img, section, span, cards, etc.):
Standard rounded classes:
rounded-sm, rounded, rounded-md, rounded-lg, rounded-xl, rounded-2xl, rounded-3xl, rounded-full
Directional rounded classes:
rounded-t-*, rounded-b-*, rounded-l-*, rounded-r-*
rounded-tl-*, rounded-tr-*, rounded-bl-*, rounded-br-*
Arbitrary values:
rounded-[*] (any custom values like rounded-[0.75rem])
EXCEPTIONS - Keep rounded-* on:
Buttons (button.tsx):
- Keep all rounded-* classes on buttons
- Different variants need different radii (pill buttons = rounded-full)
- Button styling is controlled in button.tsx, not globals.css
Avatars (avatar.tsx):
- Keep
rounded-full on avatar components
- Avatars are always circular by design convention
KEEP these border classes:
border (basic border)
border-border (uses CSS variable)
WHY: Border-radius is controlled globally via --radius in globals.css
The CSS rules in globals.css automatically apply correct border-radius to:
- Cards and containers (--radius-lg)
- Images (--radius-md)
- Badges (--radius-sm)
- Inputs (--radius-md)
- Accordion items (--radius-md)
- Navigation menus (--radius-sm)
- Popovers and dialogs (--radius-lg)
Border Cleanup Example
// BEFORE
<div className="rounded-lg border p-4">
<img className="rounded-xl w-full" />
<section className="rounded-2xl bg-muted">
// AFTER
<div className="border p-4">
<img className="w-full" />
<section className="bg-muted">
Classes to KEEP
Layout:
- flex, inline-flex, grid, block, inline-block
- gap-, space-, items-, justify-
Responsive prefixes:
Spacing:
- p-, m-, px-, py-, pt-, pb-, pl-, pr-
- mt-, mb-, ml-, mr-, mx-, my-
Colors on containers:
- bg-muted, bg-primary, bg-secondary, bg-accent
- text-muted-foreground (on p, span - not headings)
Other:
- w-, h-, max-w-, min-h-
- border-*
- transition-, animate-, duration-*
- relative, absolute, fixed, sticky
Heading Hierarchy Rules
- One H1 per page - Only the main page title uses h1
- Sequential order - h1 → h2 → h3 → h4 (no skipping)
- Section titles - Use h2 for section headings
- Subsections - Use h3 for subsection headings
Fixing Hierarchy
If a section has:
<h1>Section Title</h1> // Wrong - should be h2
<h3>Feature</h3> // Wrong - should follow h2
Change to:
<h2>Section Title</h2> // Correct
<h3>Feature</h3> // Now correct (follows h2)
Example Cleanup
Before:
<h1 className="text-5xl font-bold tracking-tight leading-tight">
Page Title
</h1>
<h2 className="text-3xl font-semibold tracking-tight">
Section Title
</h2>
After:
<h1>Page Title</h1>
<h2>Section Title</h2>
Output
- Components with clean heading tags
- Proper heading hierarchy
- Typography controlled by globals.css
1---2name: remove-inline-styles3description: Clean up shadcnblocks sections by removing inline typography styles and fixing heading hierarchy. Use after installing sections with install-sections. Removes text-xl, font-bold, tracking-tight from headings. Ensures proper h1 to h2 to h3 order and one h1 per page.4---5
6# Style Cleanup
7
8Remove inline typography styles from shadcnblocks sections and fix heading hierarchy.
9
10## Workflow
11
121. **Read Component** - Load the section component file
132. **Remove Typography Classes** - Strip inline styles from h1-h6
143. **Check Heading Hierarchy** - Verify proper h1 > h2 > h3 order
154. **Fix Hierarchy Issues** - Adjust heading levels if needed
165. **Verify Single H1** - Ensure only one h1 per page
17
18## Classes to REMOVE from h1-h6
19
20See references/cleanup-rules.md for complete list.
21
22**Typography sizes:**
23- text-4xl, text-5xl, text-6xl, text-7xl
24- text-3xl, text-2xl, text-xl, text-lg
25- uppercase, lowercase, capitalize
26
27**Font weights:**
28- font-bold, font-semibold, font-medium, font-light
29
30**Letter spacing:**
31- tracking-tight, tracking-wide, tracking-normal, tracking-tighter
32
33**Line height:**
34- leading-tight, leading-snug, leading-normal, leading-relaxed
35
36**Text colors on headings:**
37- bg-muted-foreground (when used with bg-clip-text)
38
39**Button styles:**
40- Any custom button style which is not from the <Button> component
41- e.g., bg-*, text-*, p-*, m-* on buttons
42
43## Border-Radius Classes to REMOVE
44
45Remove from MOST elements (div, img, section, span, cards, etc.):
46
47**Standard rounded classes:**
48- `rounded-sm`, `rounded`, `rounded-md`, `rounded-lg`, `rounded-xl`, `rounded-2xl`, `rounded-3xl`, `rounded-full`
49
50**Directional rounded classes:**
51- `rounded-t-*`, `rounded-b-*`, `rounded-l-*`, `rounded-r-*`
52- `rounded-tl-*`, `rounded-tr-*`, `rounded-bl-*`, `rounded-br-*`
53
54**Arbitrary values:**
55- `rounded-[*]` (any custom values like `rounded-[0.75rem]`)
56
57## EXCEPTIONS - Keep rounded-* on:
58
59**Buttons (button.tsx):**
60- Keep all rounded-* classes on buttons
61- Different variants need different radii (pill buttons = rounded-full)
62- Button styling is controlled in button.tsx, not globals.css
63
64**Avatars (avatar.tsx):**
65- Keep `rounded-full` on avatar components
66- Avatars are always circular by design convention
67
68**KEEP these border classes:**
69- `border` (basic border)
70- `border-border` (uses CSS variable)
71
72**WHY:** Border-radius is controlled globally via `--radius` in globals.css
73The CSS rules in globals.css automatically apply correct border-radius to:
74- Cards and containers (--radius-lg)
75- Images (--radius-md)
76- Badges (--radius-sm)
77- Inputs (--radius-md)
78- Accordion items (--radius-md)
79- Navigation menus (--radius-sm)
80- Popovers and dialogs (--radius-lg)
81
82### Border Cleanup Example
83
84```tsx
85// BEFORE
86<div className="rounded-lg border p-4">
87<img className="rounded-xl w-full" />
88<section className="rounded-2xl bg-muted">
89
90// AFTER
91<div className="border p-4">
92<img className="w-full" />
93<section className="bg-muted">
94```
95
96## Classes to KEEP
97
98**Layout:**
99- flex, inline-flex, grid, block, inline-block
100- gap-*, space-*, items-*, justify-*
101
102**Responsive prefixes:**
103- sm:, md:, lg:, xl:, 2xl:
104
105**Spacing:**
106- p-*, m-*, px-*, py-*, pt-*, pb-*, pl-*, pr-*
107- mt-*, mb-*, ml-*, mr-*, mx-*, my-*
108
109**Colors on containers:**
110- bg-muted, bg-primary, bg-secondary, bg-accent
111- text-muted-foreground (on p, span - not headings)
112
113**Other:**
114- w-*, h-*, max-w-*, min-h-*
115- border-*
116- transition-*, animate-*, duration-*
117- relative, absolute, fixed, sticky
118
119## Heading Hierarchy Rules
120
1211. **One H1 per page** - Only the main page title uses h1
1222. **Sequential order** - h1 → h2 → h3 → h4 (no skipping)
1233. **Section titles** - Use h2 for section headings
1244. **Subsections** - Use h3 for subsection headings
125
126### Fixing Hierarchy
127
128If a section has:
129```jsx
130<h1>Section Title</h1> // Wrong - should be h2
131<h3>Feature</h3> // Wrong - should follow h2
132```
133
134Change to:
135```jsx
136<h2>Section Title</h2> // Correct
137<h3>Feature</h3> // Now correct (follows h2)
138```
139
140## Example Cleanup
141
142Before:
143```jsx
144<h1 className="text-5xl font-bold tracking-tight leading-tight">
145 Page Title
146</h1>
147<h2 className="text-3xl font-semibold tracking-tight">
148 Section Title
149</h2>
150```
151
152After:
153```jsx
154<h1>Page Title</h1>
155<h2>Section Title</h2>
156```
157
158## Output
159
160- Components with clean heading tags
161- Proper heading hierarchy
162- Typography controlled by globals.css