Repository navigation
Fix nav bar overlapping the top of rendered notebook pages - #56
Merged
Merged
Conversation
The padding added in radio-astro-tools#51/radio-astro-tools#53 never took effect. nbconvert's lab template renders <body class="jp-Notebook">, and its `.jp-Notebook { padding: var(--jp-notebook-padding); }` rule (10px) outranks a bare `body` selector regardless of source order, so the computed padding-top stayed at 10px and the 42px nav bar covered the first notebook cell (the "Questions or issues?" note). Match `body.jp-Notebook` as well so the 60px padding wins. Co-Authored-By: Claude Opus 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
body { padding-top: 60px }rule from Add gap below nav bar on rendered notebook pages #53 never took effect.<body class="jp-Notebook">, and its stylesheet includes.jp-Notebook { padding: var(--jp-notebook-padding); }(10px). A class selector outranks a barebodyselector regardless of source order, so the computedpadding-topwas 10px, and the 42px absolutely positioned nav overlapped the content.body.jp-Notebookas well (body, body.jp-Notebook { padding-top: 60px; }), with a comment explaining why the class is needed.Test plan
Rendered
fitting_with_spectralcube.ipynblocally (nbconvert 7.16.4, not executed), raninsert_header.inject()on it, and measured the layout in headless Chromium (Brave) at 1400px and 600px widths:bodypadding-topAfter merge, confirm on the live site that the "Questions or issues?" note is fully visible below the nav.
Note: CI's nbconvert version isn't pinned (it comes in via
notebook), so a future template that renames the<body>class could bring this back.🤖 Generated with Claude Code