Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(components): use "supports-hover" to improve display on mobile devices #4519

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

Conversation

Mirrorgo
Copy link

@Mirrorgo Mirrorgo commented Aug 7, 2024

Add supports-hover variant to Tailwind config for better mobile UX

  • Introduces a new Tailwind variant 'supports-hover'
  • Uses @media (hover: hover) to target devices with true hover capability
  • Allows conditional application of hover styles
  • Fixes inconsistent toggle button behavior on touch devices
  • Maintains hover effects on desktop while disabling them on most mobile devices

Copy link

vercel bot commented Aug 7, 2024

@Mirrorgo is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@Mirrorgo
Copy link
Author

Mirrorgo commented Aug 7, 2024

I added this feature mainly for this issue: #4457. I currently use the supports-hover method. Do I need to modify other hover elements to optimize the experience, or should I only modify the toggle component for now?

Copy link

@oliverox oliverox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm those changes fixes the issue on mobile.

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

Successfully merging this pull request may close these issues.

2 participants