DEV Community

truongductri01
truongductri01

Posted on

Solving the sticky hover effect on Mobile with TailwindCSS

Here is the video explaining the concepts of avoiding using hover on device not supporting the feature: https://youtu.be/uuluAyw9AI0.
This just talk about the CSS approach.

For Tailwind, the team has developed a configuration in the tailwind.config.js file that only support hover when needed:

// tailwind.config.js
module.exports = {
  future: {
    hoverOnlyWhenSupported: true,
  },
  // ...
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay