Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: enhance hover variant to include pointer fine media query #17509

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DotwoodMedia
Copy link

Added an extra check that disables hover on chrome mobile. At the moment hover remains active in the latest version of chrome

@DotwoodMedia DotwoodMedia requested a review from a team as a code owner April 2, 2025 14:02
@philipp-spiess
Copy link
Member

@DotwoodMedia Hey! Appreciate the PR but it seems redundant to add this. Do you have any information on what Chrome mobile device is affected by a bug there? What version of Chrome is this device running, etc?

@DotwoodMedia
Copy link
Author

Hi @philipp-spiess the hovers are now active on Chrome, but we don't really want hovers there since they don't seem relevant, right? The device is running Chrome 134.0.6998.135

@Vincentdevreede
Copy link

Vincentdevreede commented Apr 7, 2025

@philipp-spiess I can confirm the findings shared by @DotwoodMedia see my attachments for further reference.

  • iOS correctly applies the a:hover CSS selector as expected.
  • Android respects the @media (hover: hover) condition and applies a:hover styles accordingly — however, this is not desirable behavior on a mobile touch device, as it implies hover capabilities that typically aren't present on touchscreens.

You can verify this yourself at: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover

Android.mp4
iOS.mp4

@Vincentdevreede
Copy link

@DotwoodMedia a temporary solution could be to create a custom variant for hover

css/main.css

@custom-variant hover {
  @media (hover: hover) and (pointer: fine) {
    &:hover {
      @slot;
    }
  }
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants