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-hit-target-expansion.md
1---2title: Hit Target Expansion with Pseudo-Elements3impact: MEDIUM4tags: pseudo, hit-target, accessibility5---67## Hit Target Expansion with Pseudo-Elements89Use negative inset values to expand hit targets without extra markup.1011**Incorrect (wrapper for hit target):**1213```tsx14<div className={styles.wrapper}>15<a className={styles.link}>Link</a>16</div>17```1819**Correct (pseudo-element expansion):**2021```css22.link {23position: relative;24}2526.link::before {27content: "";28position: absolute;29inset: -8px -12px;30}31```32