Replace 100vw with 100% where classic scrollbars cause overflow - #71
Closed
minimaldesign wants to merge 1 commit into
Closed
Replace 100vw with 100% where classic scrollbars cause overflow#71minimaldesign wants to merge 1 commit into
minimaldesign wants to merge 1 commit into
Conversation
100vw is defined as the viewport width assuming no scrollbars, so on Windows and Linux (classic, space-taking scrollbars) any scrollable page with .layout on body was ~17px wider than the visible area, producing a permanent horizontal scrollbar in Chrome. The header overlay and the read-progress bar keyframe had the same overshoot in milder forms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Deploy Preview for mcssdev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.

Summary
On Windows and Linux, scrollbars are classic (they take layout space), and
100vwis spec-defined as the viewport width assuming no scrollbars. So on any page tall enough to scroll,.layout { width: 100vw }onbodymade the page ~17px wider than the visible area, giving every scrollable page a permanent horizontal scrollbar in Chrome on Windows. macOS overlay scrollbars take no space, which is why it never showed there.Three fixes, all
100vw→100%:global.layout.css: the reported bug.bodyis a block-level child ofhtml, so100%resolves to the initial containing block, which correctly excludes a classic scrollbar.component.header.css: the full-screen menu overlay isposition: fixed, so its overflow doesn't create a scrollbar, but its right ~17px (including its ownoverflow-yscrollbar) sat under the page scrollbar. Percentages on fixed elements resolve against the initial containing block, so100%is exact.component.readProgressBar.css: theto { width: 100vw }keyframe made the bar reach full visible width ~17px of scroll before the actual bottom of the page.dist/regenerated via the pre-commit hook.Test plan
npm run lint:cssandcheck:layerspass.Appearance → Show scroll bars → Alwaysforced via macOS system settings): no horizontal scrollbar on scrollable pages, menu overlay still spans the full width, progress bar completes exactly at the bottom.🤖 Generated with Claude Code