Skip to content

fix(docs): switch .toc-aside from position:fixed to sticky in flex .main row#3527

Merged
Sayt-0 merged 1 commit into
docker:mainfrom
dgageot:worktree-board-c4ad975b14c66f77
Jul 8, 2026
Merged

fix(docs): switch .toc-aside from position:fixed to sticky in flex .main row#3527
Sayt-0 merged 1 commit into
docker:mainfrom
dgageot:worktree-board-c4ad975b14c66f77

Conversation

@dgageot

@dgageot dgageot commented Jul 8, 2026

Copy link
Copy Markdown
Member

The right-sidebar table of contents (.toc-aside) was using position:fixed and a full viewport height, which caused it to overlap the site footer when a reader scrolled to the bottom of a long page. Since fixed positioning takes the element out of flow, there was no natural boundary to stop it from sitting on top of the footer.

The fix replaces position:fixed with position:sticky on .toc-aside, pins it just below the header with top, and gives it a bounded max-height plus overflow-y:auto so it scrolls independently when the page content is taller than the viewport. To make content and TOC proper flow siblings, .main is set to display:flex with flex-direction:row at the ≥1280px breakpoint. The now-redundant max-width:1280px visibility-hide rule for the TOC is removed since visibility is still controlled by the default hidden state and the breakpoint show rule.

No template or JS changes are needed. Verified with a Hugo build via the docs Dockerfile; task lint and task test are clean.

…ain row

Prevents the right-sidebar ToC from overlapping the site footer;
hidden by default and shown only at the ≥1280px breakpoint.

Assisted-By: claude-opus-4-5
@dgageot
dgageot requested a review from a team as a code owner July 8, 2026 09:23

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

The CSS change correctly replaces position:fixed with position:sticky on .toc-aside and introduces a flex row layout on .main at the ≥1280px breakpoint. No real bugs were found in the introduced changes.

Analysis summary: Two potential concerns around position:sticky were investigated and dismissed: (1) the ancestor chain (html → body → .main → .toc-aside) has no overflow:hidden/auto/scroll that would break sticky; (2) the flex setup is textbook-correct — align-items:flex-start on .main plus align-self:flex-start on .toc-aside ensure the item doesn't stretch to full height, and top:var(--header-height) is present. The breakpoint semantics (TOC shown at ≥1280px) are preserved correctly with the default display:none + @media(min-width:1280px) { display:block } pattern.

@aheritier aheritier added area/docs Documentation changes kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Jul 8, 2026
@Sayt-0
Sayt-0 merged commit 847a791 into docker:main Jul 8, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation changes kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants