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.
Fix TOC scrolling limitation in sidebar
Problem
The table of contents (TOC) in the right sidebar had a scrolling limitation where users couldn't scroll to see the last few sections when the TOC list was long, unless they were near the bottom of the article page.
Root Cause
The
max-height
calculation for the TOC (--toc-height
) didn't correctly account for the actual sticky positioning of the TOC menu. Specifically:calc(var(--spacing) * 35)
= 8.75rem (using Tailwind's spacing system)--toc-top
= 6rem (navbar + toolbar height)This resulted in a 2.75rem + 3.7rem = 6.45rem discrepancy, causing the scrollable area to be too large and cutting off the bottom of the TOC.
Solution
--toc-top
to use the actual sticky positioning value:calc(var(--spacing) * 35)
(8.75rem)--toc-height
to properly account for all spacing:calc(100vh - var(--toc-top) - 6.2rem)
top: var(--toc-top)
instead of the hardcoded valueTechnical Details
--spacing
variable (0.25rem) for consistency with the overall design system* 35
multiplier was empirically determined to position the TOC correctly relative to other page elementsTesting
This shows the actual last section at the end:
comapre with: https://circleci.com/docs/reference/configuration-reference/ (scroll to end)