Recently, I added hovering tooltips to the list of blog posts, but I really didn’t like how they flashed for a moment when you tapped a link on mobile.
It turns out there’s an (apparently undocumented) Tailwind feature that allows you to enable hover styles only on supported devices, so I’m making this post as a public service.
In tailwind.config.js
, you can add the following:
This will only show hover styles (hover:*
, group-hover:*
, etc.) if the user’s device has proper hover support.