Skip to content

Replace 100vw with 100% where classic scrollbars cause overflow - #71

Closed
minimaldesign wants to merge 1 commit into
mainfrom
fix-100vw-classic-scrollbars
Closed

Replace 100vw with 100% where classic scrollbars cause overflow#71
minimaldesign wants to merge 1 commit into
mainfrom
fix-100vw-classic-scrollbars

Conversation

@minimaldesign

Copy link
Copy Markdown
Owner

Summary

On Windows and Linux, scrollbars are classic (they take layout space), and 100vw is spec-defined as the viewport width assuming no scrollbars. So on any page tall enough to scroll, .layout { width: 100vw } on body made 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 100vw100%:

  • global.layout.css: the reported bug. body is a block-level child of html, so 100% resolves to the initial containing block, which correctly excludes a classic scrollbar.
  • component.header.css: the full-screen menu overlay is position: fixed, so its overflow doesn't create a scrollbar, but its right ~17px (including its own overflow-y scrollbar) sat under the page scrollbar. Percentages on fixed elements resolve against the initial containing block, so 100% is exact.
  • component.readProgressBar.css: the to { 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:css and check:layers pass.
  • On the deploy preview in Chrome on Windows (or Chrome anywhere with Appearance → Show scroll bars → Always forced 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

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>
@netlify

netlify Bot commented Aug 22, 2026

Copy link
Copy Markdown

Deploy Preview for mcssdev ready!

Name Link
🔨 Latest commit 1fba11c
🔍 Latest deploy log https://app.netlify.com/projects/mcssdev/deploys/6a892c7779db3c0007811ae3
😎 Deploy Preview https://deploy-preview-71--mcssdev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100
Accessibility: 98
Best Practices: 100
SEO: 97
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@minimaldesign
minimaldesign deleted the fix-100vw-classic-scrollbars branch August 22, 2026 05:02
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

Successfully merging this pull request may close these issues.

1 participant