Solving the sticky hover effect on Mobile with TailwindCSS

truongductri01

truongductri01

Posted on April 9, 2023

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
💖 💪 🙅 🚩
truongductri01
truongductri01

Posted on April 9, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related