🐛 Theme-proof the stylesheet cascade (fix Furo render-pane padding) - #12
Merged
Conversation
Furo links furo-extensions.css AFTER extension html_css_files, so its [role=main] .container reset (0,2,0) won the specificity tie against .syntax-example > .syntax-example-render (0,2,0) and zeroed the render pane's horizontal padding — the old cascade comment's assumption that extension CSS loads last was wrong. Stop relying on stylesheet order entirely: - render pane: also match .syntax-example-render.container (0,3,0), using the container class docutils emits, beating theme resets at any load order (unqualified selector kept for writers without the class) - outer frame: .syntax-example.container neutralizes Bootstrap-style .container layout (width cap, centring margins, gutter padding) that other theme families attach to the docutils class - rewrite the cascade note to document the specificity strategy Verified in headless Chromium against a Furo build: render-pane computed padding-left 0px before, 12.8px (.8rem) after; frame geometry unchanged. 17/17 tests pass.
Merged
chrisjsewell
added a commit
that referenced
this pull request
Jul 27, 2026
Bumps `__version__` to `0.1.1` and dates the changelog entry for the Furo/theme cascade fix (#12). Verified locally: 17/17 tests pass; `python -m build` produces `0.1.1` artifacts and `twine check --strict` passes on both. After merging, pushing a `v0.1.1` tag triggers the publish workflow.
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.
Fixes the missing horizontal padding on the render pane under Furo (reported from the live RTD site).
Diagnosis — the shipped cascade comment assumed extension
html_css_filesload after theme CSS, resolving the specificity tie between Furo's[role=main] .container { padding-left/right: 0 }(0,2,0) and.syntax-example > .syntax-example-render(0,2,0) in our favour. The built page proves otherwise: Furo linksfuro-extensions.cssafter extension stylesheets (furo.css→sphinx-syntax-example.css→furo-extensions.css), so the theme wins the tie and zeroes the padding.Fix — stop relying on stylesheet order anywhere:
.syntax-example > .syntax-example-render.container(0,3,0), using thecontainerclass docutils emits on container nodes — beats theme.containerresets at any load order. The unqualified selector stays for writers that emit nocontainerclass (exactly the case where no theme.containerrule can interfere either)..syntax-example.containerrule neutralizes Bootstrap-family.containerlayout (width cap, auto-centring margins, gutter padding) so the frame keeps its own geometry on those themes too.Verification — headless Chromium against a local Furo build: render-pane computed
padding-leftwas0pxbefore,12.8px(.8rem) after; frame geometry (max-width: none, no side padding) unchanged. Full test suite 17/17. Changelog gains an## Unreleasedsection carrying the fix.Note: RTD builds install the package from the repo checkout, so the live docs pick this up on the first build after merge; PyPI users get it with the next tagged release.