nextstrain / sphinx-theme

A Sphinx theme for Nextstrain's documentation, based on Read The Docs' default theme.
https://docs.nextstrain.org/projects/sphinx-theme/
MIT License
0 stars 5 forks source link

Fix the initial scroll-into-view behaviour of the nav sidebar #27

Closed tsibley closed 2 years ago

tsibley commented 2 years ago

Overrides the default static/js/theme.js from sphinx-rtd-theme with our customized copy that fixes the initial scroll-into-view behaviour for the nav sidebar, c.f. https://github.com/readthedocs/sphinx_rtd_theme/pull/1293.

Testing

tsibley commented 2 years ago

Comparing these two pages on RTD between stable and this PR

it seems like the behaviour is not quite the same as what I see locally (though it's still improved, but not as much as appears locally).

tsibley commented 2 years ago

It's very close though, and the behaviour is identical locally and on RTD for other nav items. The difference for those particular links seems to be that the containing top-level item ("Paragraph Level Markup") is (for me) just barely longer than the viewport height when rendered on RTD with the RTD panel at the bottom of the sidebar, but not when locally without the RTD panel. Like I said though, the behaviour is still an improvement, esp. for top-level items that aren't as long.