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

移动端点击后样式一直为 hover 下的样式 #62

Closed
Tracked by #38
521xueweihan opened this issue Oct 8, 2022 · 3 comments
Closed
Tracked by #38

移动端点击后样式一直为 hover 下的样式 #62

521xueweihan opened this issue Oct 8, 2022 · 3 comments

Comments

@521xueweihan
Copy link
Member

521xueweihan commented Oct 8, 2022

上述问题出现在移动端访问时,问题的页面和具体位置如下:

  • 月刊的上一页、下一页,点击后一直处于 hover 状态下的样式

image

  • 项目详情的 moreInfo 组件点击“展开”,收缩一直处于 hover 状态下的样式

image

@521xueweihan 521xueweihan changed the title 移动端点击后样式处于点击的状态 移动端点击后样式一直为 hover 下的样式 Oct 8, 2022
@lalawow
Copy link

lalawow commented Oct 8, 2022

You can check this comment on tailwind's board . It might be able to solve your issue.
tailwindlabs/tailwindcss#1739 (comment)

@cqh963852
Copy link
Collaborator

  • 月刊的上一页、下一页,点击后一直处于 hover 状态下的样式

vercel/next.js#33060

关于 link 的 focus 状态,是 nextjs 的设计

@521xueweihan
Copy link
Member Author

@lalawow @cqh963852
感谢帮助,已按照 @lalawow 提供的解决方案解决「移动端 hover 样式的异常」

解决办法:

// tailwind.config.js
module.exports = {
  future: {
    hoverOnlyWhenSupported: true,
  },
  // ...
}

提示:该解决方案 tailwind 必须为 3.1 版本以上

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

No branches or pull requests

3 participants