Right Scrollbar not scrolling with the page #800
-
First of all, thank you to the contributors for this wonderful sphinx theme. As per the documentation, the right sidebar scroll behavior should be as follows.
But this is not happening with my generated docs. The highlighted entry does change with scrolling, but on scrolling further the highlighted entry is out of the page. The right sidebar scroll position jumps to it's bottom when the main content scroll position is at the bottom. I would also like to know if the navigation depth of the toctree shown in the right sidebar can be specified in the theme options. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I can reproduce this in
There is not. #289, #557, #566, and perhaps other threads go into why. |
Beta Was this translation helpful? Give feedback.
-
I figured it out!!!! With some help from Chat-GPT of course. I've never programmed with JS.😅 The furo.js is to be modified as per the attached file. The CSS style of The scroll position of the Now the right sidebar with the toc entries scrolls with the page and maintains the highlighted entry at 25% from the top of the browser window. Initially it broke the 'Back to top' button but that has been fixed too. I could only test this for my generated docs. The variable names and formatting of 'furo.js' is modified heavily. I am trying to see if there are bugs due to this process. I hope this solution is applicable for all general cases. |
Beta Was this translation helpful? Give feedback.
I figured it out!!!! With some help from Chat-GPT of course. I've never programmed with JS.😅
The furo.js is to be modified as per the attached file.
furo js script.txt
The CSS style of
toc-tree-container
is to be modified as follows in a custom css..toc-tree-container { padding-bottom: var(--toc-spacing-vertical); max-height: 100vh; overflow: auto; scroll-behavior: smooth; }
The scroll position of the
toc-tree-container
class ìs controlled rather than thetoc-scroll
class, thereby keeping the 'On this page' division within the window while scrolling.Now the right sidebar with the toc entries scrolls with the page and maintains the highlighted entry at 25% from the top of the browser win…