-
Notifications
You must be signed in to change notification settings - Fork 339
Safari bug: anchor links stay behind the navbar #325
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
Comments
@12rambau I think this is fixed in the meantime on master. See eg https://pydata-sphinx-theme.readthedocs.io/en/stable/demo/generated/pandas.DataFrame.drop.html#pandas.DataFrame.drop vs https://pydata-sphinx-theme.readthedocs.io/en/latest/demo/generated/pandas.DataFrame.drop.html#pandas.DataFrame.drop using our demo docs (link for stable release vs development version) |
For both of them the title was hidden behind the navbar. As we are entering the horrible zone of device compatibility I use : It works on Firefox 84.0.2 on the latest doc |
Hmm. I was using firefox, so there indeed in now works (and didn't work for the stable release). For Chrome it seems to work as well (at least on Ubuntu). The latest version is using For Safari we could maybe keep what was removed in #318 as fallback? (that should work for at least most links) |
Unfortunately it is a known bug that Safari doesn't (yet) support the CSS property that we're using to handle this: |
Using something like
as @jorisvandenbossche suggests would probably work for your specific example, @12rambau, but you should know that it has a drawback: any inline anchors that are targeted (i.e., a mid-sentence citation that is the target of a backreference) will be quite badly broken (they willl break the line, and if they have Personally I would hesitate to re-incorporate that behavior into the theme; I think the failure to scroll on safari is less bad than the side-effect for inline targets that I just described... I would recommend individual users to add the above to their site's CSS if (1) they know they won't have any inline target anchors, or (2) they think the scrolling problem is too painful and are willing to accept the breakage to the inline target anchors. |
I think this is a very minor problem. I agree that breaking inline anchor is a big risk and if it's only to save a bug from Safari it's not worth it. I will let the issue open until a new workaround emerge OR the bug solve itself with a update of safari |
Indeed, probaby best to keep it as is in the theme. Now, if you know as a downstream user that you don't have any inline anchors, you can still put the above css snippet in your custom.css. |
FWIW, the workaround is to use I first noticed this in https://github.com/squidfunk/mkdocs-material/blob/714a9cc7d1e33b250753c722d87d54cdabc39d3d/docs/changelog.md#516-_-may-9-2020, and this is what Furo does: |
It seems that the bug is now solved from Safari's side. (At least it's not an issue on my docs any more) |
When I type a search in my search bar like for example
NumberField
in https://sepal-ui.readthedocs.io/en/latest/index.htmland select one of the found anchor (https://sepal-ui.readthedocs.io/en/latest/modules/sepal_ui.sepalwidgets.html?highlight=NumberField#sepal_ui.sepalwidgets.inputs.NumberField) the anchor is placed behind the navbar. Is it possible to add extra padding to the js script ?
It appears this way :
And it would be more useful

this way :
The text was updated successfully, but these errors were encountered: