Performance: Active and focus states
MEDIUM IMPACT
This concept affects interaction responsiveness and visual stability during user input.
button:focus-visible { outline: 2px solid #005fcc; } button:active { background-color: #004a99; }
button:focus, button:active { outline: none; box-shadow: 0 0 10px 5px rgba(0,0,0,0.5); border-width: 3px; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Heavy box-shadow and border-width on :active/:focus | None | Multiple reflows per interaction | High paint cost due to shadows | [X] Bad |
| Outline and background-color changes on :focus-visible and :active | None | No reflows | Low paint cost | [OK] Good |