Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Nov 19, 2025

aside.table-of-contents .toc-sticky nav had height: calc(100vh - var(--layout-header-height))
but height should exclude padding and height of <h3>On This Page</h3> element.
This calculation is hard, so I use display:flex instead.

Left: before, Right: after
before_after

Scenario: scroll to page bottom
Left: before, Right: after
beforeafter_scrollbottom

@tompng tompng temporarily deployed to fork-preview-protection November 19, 2025 05:39 — with GitHub Actions Inactive
@matzbot
Copy link
Collaborator

matzbot commented Nov 19, 2025

🚀 Preview deployment available at: https://037fc629.rdoc-6cd.pages.dev (commit: a9e975a)

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Thanks

aside.table-of-contents .toc-sticky {
display: flex;
flex-direction: column;
height: calc(100vh - var(--layout-header-height) - var(--space-8) * 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining this calculation?

@tompng tompng requested a deployment to fork-preview-protection November 19, 2025 12:27 — with GitHub Actions Waiting
@tompng tompng merged commit 04c1f75 into ruby:master Nov 19, 2025
31 of 32 checks passed
@tompng tompng deleted the toc_scroll_height branch November 19, 2025 12:52
@st0012 st0012 changed the title Adjust table of content scrollable area height [Aliki] Adjust table of content scrollable area height Nov 22, 2025
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.

4 participants