fix(web/style): 真正消除 post-list hover 抖动 — 始终挂载滚动条+透明 thumb#111
Merged
Conversation
PR #109 用 scrollbar-gutter: stable 想保留 gutter,但 CSS 规范规定 gutter 在 scrollbar-width: none 时是 no-op,所以那行修改实际上根本 没生效,hover 切到 auto 仍然会真占走 ~10px。Scott 反馈刷新后还在抖 就是这个原因。 正确做法:让 scrollbar 始终挂载且宽度固定,默认 thumb / track 全透明, hover 时把 thumb 上色。视觉上跟之前的 Slack-style hover-reveal 完全一样 (默认看不到、hover 出现),但布局宽度恒定,鼠标进出零 reflow。 - WebKit/Chromium/Safari:::-webkit-scrollbar 固定 width: 10px, ::-webkit-scrollbar-thumb 默认 transparent,hover 时上色。 - Firefox:scrollbar-width: thin + scrollbar-color: transparent transparent 默认,hover 时把 thumb 颜色切到 rgba(0,0,0,0.25)。 - 加 0.15s transition 让出现/消失更柔和。 SW 已经在 v2 = network-first,下次硬刷新一次直接生效。
🤖 bot-review (comment-only · phase 1)Diff: Red-line checks:
Phase 2: auto-approve + auto-merge fire only when red-lines are clean, author is internal, and no needs-human path is touched. Block with |
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.
问题
PR #109 用了
scrollbar-gutter: stable想给隐藏的滚动条保留 gutter,让 hover 切到auto时不抢宽度。但是 CSS 规范规定scrollbar-gutter在scrollbar-width: none时是 no-op——scrollbar 被 suppress 掉就没 gutter 可保留——所以那行修改实际上根本没生效,hover 时仍然真占走 ~10px。Scott 多次反馈刷新后还在抖就是这个原因。修复
让滚动条始终挂载、宽度固定,但 thumb 和 track 默认完全透明,hover 时给 thumb 上色:
视觉上跟之前的 Slack-style hover-reveal 完全一致:默认看不到、hover 出现、hover 在 thumb 上颜色加深;区别只在布局宽度恒定,鼠标进出零 reflow。
跨浏览器:WebKit / Chromium / Safari 走
::-webkit-scrollbar*,Firefox 走scrollbar-width: thin+scrollbar-color两件套。0.15s transition 让出现/消失更柔和。部署
SW 在 PR #110 已经改成 network-first,硬刷新一次就直接生效,不需要再 unregister。