Repository navigation
docs: pin the left nav from 960px wide, with a button to hide it - #344
Merged
Merged
Conversation
The theme only pins the navigation sidebar from 1220px, leaving it behind the hamburger menu on narrower windows, and has no setting for that or for collapsing it. A build hook moves the breakpoint to 60em in the theme's stylesheet and JavaScript, and a header button hides the sidebar, remembered between pages and visits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The docs theme (MaterialX) only pins the left navigation from 1220px wide. Below that it sits behind the hamburger menu, so on many laptop windows the docs show no navigation at all. The theme has no setting for that width or for collapsing the sidebar, so:
docgen/sidebar_breakpoint.py: a post-build hook that moves the theme's breakpoint from 76.25em (1220px) to 60em (960px), in both its stylesheet and its JavaScript, which uses the same width to position the sidebar. It logs a warning if a future theme version no longer has those values.docs/javascripts/nav_toggle.js: a header button, in the hamburger's place, labelled "Hide navigation" or "Show navigation". The choice is remembered between pages and visits, anddocs/overrides/main.htmlapplies it before the page draws, so the nav doesn't flash.docs/assets/stylesheets/extra.css: shows the button only where the nav is pinned, and moves the earlier "keep top tabs visible" rule to the new width.Below 960px nothing changes: hamburger and slide-out menu as before.
Test plan
prek runpassesNot changed: the nav still lists only the current top tab's section, and the button label is English only.
🤖 Generated with Claude Code