Performance: Why interactive states need styling
MEDIUM IMPACT
This affects how quickly users see visual feedback when interacting with elements, impacting input responsiveness and visual stability.
<button class="bg-blue-500 hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-400">Click me</button><button class="bg-blue-500">Click me</button>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No interactive styles | Minimal | 0 | Minimal | [X] Bad - poor user feedback |
| Color change on hover/focus | Minimal | 0 | Low | [OK] Good - fast feedback |
| Layout change on hover (e.g., padding) | Minimal | 1+ per interaction | Medium | [!] OK - causes reflows |
| Complex animations on focus | Minimal | 0 | High | [!] OK - costly paint |