executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
431 stars 197 forks source link

Anchor links have incorrect offset from top of screen #667

Closed choldgraf closed 1 year ago

choldgraf commented 1 year ago

When you click an in-page link (e.g. an anchor link) the link target is partially blocked by the article header.

This is because we are over-riding the header-height here to be 0px:

https://github.com/executablebooks/sphinx-book-theme/blob/8e087097e90c530440a25f724423faf6c99c2c37/src/sphinx_book_theme/assets/styles/abstracts/_variables.scss#L39

The pydata theme is setting scroll-padding-top to be relative to this height, which is why setting the height to 0 is causing this to overlap.

mathbunnyru commented 1 year ago

A few other things I noticed during comparison:

pre-release: https://jupyter-docker-stacks--1855.org.readthedocs.build/en/1855/using/recipes.html stable: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html

  1. In the pre-release version anchers are grey (they are not black). I liked black version better, but it might be my taste.
Screenshot 2023-01-05 at 19 08 23 Screenshot 2023-01-05 at 19 08 27
  1. I liked the text and the centred logo in the left-up corner. Now there is only a logo and it's not centred.
Screenshot 2023-01-05 at 19 12 24 Screenshot 2023-01-05 at 19 12 28
  1. "Search the docs..." and "⌘ + K" are clashing (minor issue, can be ignored).

  2. Italic text in the anchors adds an extra space in the On this page (contents) section. I think it might have happened before, but it's visible now.

Screenshot 2023-01-05 at 19 09 33 Screenshot 2023-01-05 at 19 09 37
choldgraf commented 1 year ago

this is super helpful, thanks! that's what we have pre-releases for :-)

choldgraf commented 1 year ago

In the PR linked above I also fixed the header color change, there are a few others that we'll need to follow up on separately. Could you open issues for them?

mathbunnyru commented 1 year ago

I added two issues for the last 2 problems. Also added a note that whitespace is quite important in the upcoming release (because it is easily seen and doesn't look nice).

Thanks for all the fixes, it looks much better now.

choldgraf commented 1 year ago

Also added a note that whitespace is quite important in the upcoming release (because it is easily seen and doesn't look nice).

I agree - I just cannot for the life of me figure out how to fix it :-D