Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix sphinx-gallery CSS #27798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 18, 2024
Merged

Fix sphinx-gallery CSS #27798

merged 2 commits into from
Feb 18, 2024

Conversation

timhoffm
Copy link
Member

This collects two commits:


Remove unused .sphx-glr-thumbcontainer .figure. The .figure div was removed in
sphinx-gallery/sphinx-gallery#906

The workaround is also not needed anymore because that PR fixes the
centering.


Set a fixed height for sphinx gallery images

... so that lazy loading does not change heights. Without a fixed
height lazy loading of images interferes with anchor links: Clicking a
link goes to a certain position, but then the loaded images add content
and move the anchor to a different position.

The position change problem that this addresses can be reproduces as follows:

  1. Go to https://matplotlib.org/devdocs/gallery/index.html
  2. In the right menu "On this page" click a link (somewhat further down) e.g. "Animation"
  3. The page scrolls to that position; then lazy loading of the images in between sets in and move the Animation section off screen.

The div.figure was removed in
sphinx-gallery/sphinx-gallery#906

The workaround is also not needed anymore because that PR fixes the
centering.
... so that lazy loading does not change heights. Without a fixed
height lazy loading of images interferes with anchor links: Clicking a
link goes to a certain position, but then the loaded images add content
and move the anchor to a different position.
@timhoffm timhoffm added the Documentation: build building the docs label Feb 16, 2024
@timhoffm timhoffm added this to the v3.9.0 milestone Feb 16, 2024
@timhoffm
Copy link
Member Author

@timhoffm timhoffm merged commit fd5f164 into matplotlib:main Feb 18, 2024
@timhoffm timhoffm deleted the doc-gallery-height branch February 18, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: build building the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants