fix: prevent horizontal scrollbar on sticky TOC#363
Merged
Conversation
Add overflow-x: hidden to the sticky TOC container to prevent a horizontal scrollbar from appearing when long section titles wrap in the 'On this page' sidebar.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #363 +/- ##
=======================================
Coverage ? 45.92%
=======================================
Files ? 2
Lines ? 405
Branches ? 0
=======================================
Hits ? 186
Misses ? 219
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
🎭 Visual Regression Test ResultsDetails
Skipped testsmobile-chrome › theme.spec.ts › Theme Features › f-string interpolation styling |
Contributor
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.
Fix: Horizontal scrollbar on sticky "On this page" TOC
Problem
The sticky "On this page" table-of-contents sidebar displays an unwanted horizontal scrollbar at the bottom when section titles are long enough to wrap (e.g. "13.10. Stochastic Difference Equation").
Reported in: QuantEcon/lecture-python.myst#809
Solution
Add
overflow-x: hiddento the.inner.stickycontainer in the page TOC styles. This clips any minor horizontal overflow from wrapped text, preventing the scrollbar from appearing.Changes
src/quantecon_book_theme/assets/styles/_page.scss— addedoverflow-x: hiddento.qe-page__toc .inner.sticky