Performance: Hover variant
MEDIUM IMPACT
Hover variants affect interaction responsiveness and paint performance when users move their mouse over elements.
<button class="hover:bg-blue-500 hover:text-white">Click me</button> <button class="hover:bg-blue-500 hover:text-white">Click me</button> <button class="hover:bg-blue-500 hover:text-white">Click me</button> <!-- simpler hover styles -->
<button class="hover:bg-blue-500 hover:text-white hover:shadow-lg">Click me</button> <button class="hover:bg-blue-500 hover:text-white hover:shadow-lg">Click me</button> <button class="hover:bg-blue-500 hover:text-white hover:shadow-lg">Click me</button> <!-- repeated many times -->
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Complex hover styles (background, shadow) | None | Possible if layout changes | High paint cost | [X] Bad |
| Simple hover styles (opacity, transform) | None | None | Low paint cost | [OK] Good |