interactionsRauno
Hover States with Media Query
MUST
MUST: Gate hover styles behind `@media (hover: hover)` so touch devices never get a flash of sticky hover state on press.
Hover states should not be visible on touch press — use @media (hover: hover)
@media (hover: hover) {
.btn:hover { background: var(--accent); }
}Bad
Good
Why it matters
On touch devices, pressing an element briefly triggers its hover state, causing a flash of the hover style. Wrapping hover declarations in @media (hover: hover) ensures they only apply on devices with a true pointer, like a mouse.