Skip to content

Fix double scrollbar issue in documentation site#15

Open
WuMingDao wants to merge 1 commit intocloudflare:mainfrom
WuMingDao:main
Open

Fix double scrollbar issue in documentation site#15
WuMingDao wants to merge 1 commit intocloudflare:mainfrom
WuMingDao:main

Conversation

@WuMingDao
Copy link

Problem:
The documentation site was displaying two vertical scrollbars on the right side, creating a confusing user experience where users could scroll using either scrollbar.

fix before:
image

fix after:
image

Root Cause:
There were two nested scrollable containers:

  1. The body element had overflow-y: scroll (global.css:26)
  2. The #main-content container had overflow-y-auto (MainLayout.astro:29)

This created a double-scrolling scenario where both the body and the main content area could scroll independently.

Solution:
Changed body overflow from overflow-y: scroll to overflow: hidden, making #main-content the single source of scrolling for the entire application.

Why This Approach:
This follows the modern app-layout pattern where:

  • Fixed sidebar (SidebarNav) remains visible at all times
  • Fixed theme toggle stays in the top-right corner
  • Only the main content area scrolls
  • Consistent with modern web applications (VS Code, GitHub, etc.)

This approach provides better UX by having a single, predictable scroll container while maintaining the fixed positioning of navigation elements.

Problem:
The documentation site was displaying two vertical scrollbars on the
right side, creating a confusing user experience where users could
scroll using either scrollbar.

Root Cause:
There were two nested scrollable containers:
1. The body element had `overflow-y: scroll` (global.css:26)
2. The #main-content container had `overflow-y-auto` (MainLayout.astro:29)

This created a double-scrolling scenario where both the body and the
main content area could scroll independently.

Solution:
Changed body overflow from `overflow-y: scroll` to `overflow: hidden`,
making #main-content the single source of scrolling for the entire
application.

Why This Approach:
This follows the modern app-layout pattern where:
- Fixed sidebar (SidebarNav) remains visible at all times
- Fixed theme toggle stays in the top-right corner
- Only the main content area scrolls
- Consistent with modern web applications (VS Code, GitHub, etc.)

This approach provides better UX by having a single, predictable
scroll container while maintaining the fixed positioning of navigation
elements.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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