tailwindcss: Hover styles don't apply in Chrome 133

What version of Tailwind CSS are you using?

4.0.4 / 4.0.5 / 4.0.6

What build tool (or framework if it abstracts the build tool) are you using?

Vite with plugin

What version of Node.js are you using?

22.13.1

What browser are you using?

Chrome 132 / 133 Edge 132 / 133 Brave 132 / 133 Firefox 134 / 135

What operating system are you using?

Windows 11. Note that I’m on a touch-enabled device but am not using (and have/will never use) the tablet/touch mode.

Reproduction URL

https://play.tailwindcss.com/ejMhEzAx6k https://codesandbox.io/p/devbox/59ynks

Describe your issue

Using hover: with any Chromium 133 based browser does not apply hover styles whereas it does work in Chromium 132 based browsers.

The CSS of my project (with custom colour variables) looks like this in devtools

Chrome 133: Image

Edge 132: Image

Firefox 135: Image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 35 (8 by maintainers)

Most upvoted comments

@duprayae179dpl oh only just realised that Tailwind 4 bakes in the hover: hover query into the modifier without having to opt in through config. Sorry we are still on 3.x here.

As per @philipp-spiess comment here https://github.com/tailwindlabs/tailwindcss/issues/16416#issuecomment-2651060504

@custom-variant hover (&:hover);

Should do the trick for Tailwind 4 users until Chromium fix this.

This should be fixed in Chrome 133.0.6943.99 which is available now 👍🏻 Try upgrading and with any luck everything should work as expected now.

I’m using a regular laptop without any touch support. After upgrading to Tailwind v4, hover no longer works on Chrome. It does work properly on Edge, though.

The problem goes away after adding this override to my css:

@custom-variant hover (&:hover);

Windwos 11 Chrome: version 133.0.6943.60 (Official Build) (64-bit)

@davidfishlock @philipp-spiess I can confirm that the custom variant code above works on my end and does not populate the @media (hover: hover) code in the CSS file (see below) that detects if the device can hover or not. Thanks a bunch for this!

@media (hover: hover) {
    .hover\:text-red-500:hover {
        color: var(--color-red-500)
    }
}

I ran into this exact issue that @benweier-riotinto originally posted. None of the hover events were compiling in the Chrome dev tools for me as well. Also note that Tailwind 3.x was working perfectly fine. It happens in all of the latest browsers for me: Chrome 133.0.6943.60, Firefox 135.0 and Edge 133.0.3065.59. I have Dell XPS 9310 2-in-1 with touchscreen.

The issue at hand is the touchscreen functionality on my laptop. I tried disabling it on the OS-level: disabling the HID touchscreen device in the device manager, disabling touch input via the Control Panel, but nothing worked. I went into the BIOS and disabled the touchscreen there and everything worked 100% fine for me in all browser after that. If I turn back on the touchscreen in the BIOS, none of the hover events work any more.

If you have a touchscreen laptop, it must be disabled at the BIOS-level, not the OS-level. Something in Tailwind 4.x keeps instructing web browsers not to enable any sort of hover events. Again, TW 3.x hover events works perfectly fine. So this seems to be something related to TW 4.x. Just not sure where or what causes this.

Hopefully this helps anyone that has this issue.

All we do from the Tailwind CSS side is to prefix all :hover calls with a hover media query. 🤔 So for some reasons your Chrome browsers think that the device does not support hover even though it does. Perhaps this could be related to a DevTools setting or a browser extension? The MDN page I linked contains a test too, does these work for y’all?

One thing you can do to work around this is to overwrite the hover variant to _not test for the hover media query. You can do this via:

@custom-variant hover (&:hover);

However, you really should not have to. The hover media query is fully supported by Chrome since version 41. 🤔

Hey folks! As @davidfishlock pointed out in https://github.com/tailwindlabs/tailwindcss/issues/16416#issuecomment-2651538111:

There is currently a P0 Chrome bug affecting the use of hover media queries that breaks hover stylings.

This will be fixed in Chrome 133.0.6943.101 according to the issue log which should go out very soon.

Just FYI everyone there is a regression tracked on Chromium here.

https://issues.chromium.org/issues/394519480

Causing issues with hover: hover and pointer: fine media queries on devices like laptops with a touchscreen but also a mouse connected.

If you are using hoverOnlyWhenSupported in your tailwind config to avoid sticky touch states then this will impact you as it relies on those media queries specifically.

Would recommend considering removing hoverOnlyWhenSupported from your config for now until this is resolved in a future Chrome update, although given it has been set at P0 then shouldn’t hopefully be too long.