Skip to content

docs: fix clipped scroll area of sidebar and table of contents - #584

Closed
fabian-hiller wants to merge 1 commit into
withastro:mainfrom
fabian-hiller:fix-docs-sidebar-scroll-clipping
Closed

docs: fix clipped scroll area of sidebar and table of contents#584
fabian-hiller wants to merge 1 commit into
withastro:mainfrom
fabian-hiller:fix-docs-sidebar-scroll-clipping

Conversation

@fabian-hiller

@fabian-hiller fabian-hiller commented Aug 11, 2026

Copy link
Copy Markdown

What

On /docs/* pages, the sidebar navigation (and the "On this page" table of contents) is a sticky scroll container with overflow-y-auto. Its bounds currently start 2rem below the header and end 2rem above the viewport bottom, because the vertical spacing lives as pt/pb padding on the wrapping <aside> — outside the scroll container. As soon as the list is long enough to scroll, items get chopped mid-letter at those floating boundaries, with dead zones above and below.

CleanShot 2026-08-11 at 18 00 17@2x

Fix

Move the vertical spacing inside the scroll containers: the nav now spans the full height below the header (top: var(--docs-header-height), max-height: calc(100vh - var(--docs-header-height))) and carries the spacing itself as pt-[var(--docs-aside-top)] pb-8. Because overflow clips at the padding edge, scrolled items remain visible while passing through the padding zone and disappear cleanly at the header border and the viewport bottom.

The resting (unscrolled) layout is pixel-identical: the first item still sits 2rem below the header.

Testing

Verified locally with astro dev at various viewport heights and scroll positions on /docs/guide/channels/, comparing against production. Both the sidebar and the table of contents scroll their full content and no longer clip items at the floating boundaries.

The sidebar nav and "On this page" nav were scroll containers whose
bounds started 2rem below the header and ended 2rem above the viewport
bottom, because the vertical spacing lived as padding on the wrapping
<aside>. Once the list was long enough to scroll, items were clipped
mid-letter at those floating boundaries.

Move the vertical spacing inside the scroll containers instead, so the
scrollable area spans the full height below the header. Since overflow
clips at the padding edge, scrolled items now stay visible through the
padding zone and disappear cleanly at the header border and viewport
bottom, and the resting layout is unchanged.
@fabian-hiller

Copy link
Copy Markdown
Author

I asked Claude to create this PR. I recommend checking it before you merge it.

@astrobot-houston

Copy link
Copy Markdown

Thanks for the contribution! We're closing this PR and moving the conversation to the issue: #589

We've moved to a model where bugs and feature proposals are discussed in issues/discussions before code review, so the community can help prioritize and shape the work. Your branch is linked from the new thread so the implementation isn't lost — please join us there to continue the conversation.

— astrobot 🤖

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.

2 participants