Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/pseudo-over-dom-node.md
1---2title: Pseudo-Elements Over DOM Nodes3impact: MEDIUM4tags: pseudo, dom, decorative5---67## Pseudo-Elements Over DOM Nodes89Use pseudo-elements for decorative content instead of extra DOM nodes.1011**Incorrect (extra DOM node):**1213```tsx14<button className={styles.button}>15<span className={styles.background} />16Click me17</button>18```1920**Correct (pseudo-element):**2122```tsx23<button className={styles.button}>24Click me25</button>26```27```css28.button::before {29content: "";30/* decorative background */31}32```33