Skip to content
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

Custom CSS for space above title target conflicts with pydata-sphinx-theme #815

Closed
jorisvandenbossche opened this issue Apr 16, 2021 · 0 comments · Fixed by #816
Closed
Labels

Comments

@jorisvandenbossche
Copy link

The following snippet from sphinx-gallery's custom css conflicts with the pydata-sphinx-theme (see pydata/pydata-sphinx-theme#389, mne-tools/mne-python#9288):

.sphx-glr-example-title > :target::before {
display: block;
content: "";
margin-top: -50px;
height: 50px;
visibility: hidden;
}

Because it adds some space above each header on the page, it confuses the "highlight TOC on scroll" feature of the right side page TOC.

Now, I am not really able to understand what the above CSS is actually intended to be doing .. (but I am also no CSS expert ;)).

It was introduced in #362, and seems to be related to the "note" that is added on the top of a page (with the download link).
But, the way the CSS selector is now implemented (.sphx-glr-example-title > :target::before), it doesn't actually select the top header that is directly below the note, but every other header lower on the page (and adding some space above that). So it might be that the CSS selector is actually selecting the wrong thing (but again, not fully understanding it).
Changing the selector to .sphx-glr-example-title:target::before would have it select only the top header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants