HelloGitHub-Team / geese

采用 Next.js 构建的开源爱好者社区。An open-source enthusiast community built with Next.js.
https://hellogithub.com
Apache License 2.0
296 stars 72 forks source link

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

Closed 521xueweihan closed 2 years ago

521xueweihan commented 2 years ago

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

lalawow commented 2 years ago

You can check this comment on tailwind's board . It might be able to solve your issue. https://github.com/tailwindlabs/tailwindcss/discussions/1739#discussioncomment-3630717

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

https://github.com/vercel/next.js/issues/33060

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

521xueweihan commented 2 years ago

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

解决办法:

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

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