-
Notifications
You must be signed in to change notification settings - Fork 323
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
BUG: anchor links hidden by header navbar when this has a different height #258
Comments
I'm not really sure this is a theme bug. Perhaps there's a feature request here to allow explicit customization of the header height; but numpy should have no reason to expect it to be possible to apply random CSS dimensions to various objects and expect everything else to work. |
yeah I agree it's not a bug if it required them to manually change the CSS in order to cause this behavior. Perhaps something we should document though (and as @eric-wieser suggests leave as a feature implementation to allow for different-sized headers) |
Thanks, I agree this is self-afflicted. |
Indeed, "bug" was maybe the wrong term, but I think it would still be a nice feature that users of the theme can change the height of the navbar more easily without running into this (or having to change a different marging as well).
I think it is styled by this Something like
might do (based on some experimentation, I increased the top margin of hX, and also increased height and negative margin of hX:before, but to really explain/understand it would need to dive in a bit more) |
why not make the header size a CSS-controllable variable per #190 ? |
Ideally certainly yes, but then somebody first needs to understand how to translate the navbar height into those 3 margin/height numbers in the snippet above .. |
I am considering to add a theme css variable Would this work for the Numpy people? |
I think a variable should be fine (assuming that this will then allow the logo to expand automatically to the available space by a larger height). Also, it would be nice that the changes made for this, could also work for the case where there is no header (eg https://clustergram.readthedocs.io/en/latest/), so you can set the header-height to 0 in such a case. |
lol wow the pydata-sphinx-theme without a header looks a lot like Jupyter Book. I guess that's no coincidence 😅 |
Yup, that would be great |
The |
Reported by numpy at numpy/numpy#17207. Anchor links jump to a slight wrong place, so that the heading is a bit hidden by the navbar. Eg https://numpy.org/devdocs/user/building.html#accelerated-blas-lapack-libraries right now gives:
I suppose this happens for the numpy docs because they set their navbar (for having a larger logo) to be a bit bigger: 75px instead of the 45px in the default theme.
And then the margin added to headings to add an offset to the anchor link to appear just below the navbar doesn't match anymore.
Some related issues: #6, #147 (and linked PRs)
The text was updated successfully, but these errors were encountered: