Tailwind 3 hover styles stick on touch
Why it matters
Without hoverOnlyWhenSupported, hover: applies on tap and stays until the next tap on phones (Tailwind 4 does this by default).
Fix
tailwind.config: future: { hoverOnlyWhenSupported: true }.
Credit
From Tailwind Labs
Tailwind 4 applies hover styles only on devices that support hover, and the v3 hoverOnlyWhenSupported flag opts into the same behavior.
References
- Hover, focus, and other statesTailwind CSS
- Upgrade guideTailwind CSS
- hoverMDN Web Docs