fix(ShareBar): 修复移动端分享按钮被挤压变形 - #4382
Open
88lin wants to merge 1 commit into
Open
Conversation
问题:移动端屏幕宽度不够时,分享按钮没有横向滑动, 排在左侧的按钮被 flex 压缩变形。 修复: - w-full → w-max min-w-full:移动端允许内容溢出触发横向滚动 - 添加 flex-nowrap:禁止换行 - 添加 [&>*]:shrink-0:禁止按钮收缩变形 - 添加 scroll-hidden:隐藏滚动条 - md:w-full:桌面端恢复全宽,保持 justify-end 布局不变 影响范围:所有使用 ShareBar 公共组件的主题 桌面端布局无变化
|
@web-flow is attempting to deploy a commit to the tangly1024's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
已知问题
解决方案
components/ShareBar.js的 Tailwind 类名w-full→w-max min-w-full:移动端允许内容溢出触发横向滚动,同时保证按钮少时仍占满容器宽度flex-nowrap:显式禁止换行[&>*]:shrink-0:禁止按钮收缩变形scroll-hidden:隐藏滚动条(项目globals.css中已有定义)md:w-full:桌面端恢复全宽,保持md:justify-end右对齐布局不变改动收益
touch-pan-x已有)md:w-full覆盖w-max,md:justify-end保持右对齐endspace主题在flex justify-end容器中使用,overflow-x-auto使 flex item 可收缩+滚动,无影响具体改动
components/ShareBar.js(+2/-2 行)测试确认
md:w-full+md:justify-end保持原行为)flex-nowrap是默认值显式声明,scroll-hidden仅在溢出时生效,shrink-0仅防止按钮收缩用户文档