-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
DOC Reduce whitespace above h1 tag #26787
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
Conversation
On my screen, this change makes the section title hidden by the top bar of the website |
I'm guessing the intention of #26625 was to add more white-space above sections in the body. With |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spacing above section is not a bug but a feature. Empty space is really important for readability of documents. |
As a reference, see for instance the bootstrap documentation (eg https://getbootstrap.com/docs/5.3/getting-started/introduction/ ). Bootstrap people know a lot about UX and readability. |
In general I agree with "adding empty space helps readability". It is the number one feature to use if you need to predict if a layout was done by a professional or an amateur: look at how much empty space there is. The next feature being: is the spacing asymmetric between the top and the bottom (pros leave more space below than above). However, I think we should not spend our time arguing about this. So for me the question is: is this PR changing something that was previously changed on purpose or is it changing something which changed as a side-effect? If the former, I'd vote to leave it as is. If the latter, then lets merge this PR. The reason I think we are better of not arguing (and because none of us are experts I'd claim we are arguing not discussing ;)) is that I think something like #26809 could bring a lot of benefits in terms of readability, layout, reduced "fuzzing with HTML and CSS", accessibility, etc. This means we should invest our energy there, because it is going to be a big job. |
So for me the question is: is this PR changing something that was previously changed on purpose or is it changing something which changed as a side-effect?
The space was added on purpose.
|
Transitioning a theme well is harder than it looks |
https://output.circle-artifacts.com/output/job/b11ccb31-7f7e-44e7-8ae2-f591cbd412fe/artifacts/0/doc/modules/generated/sklearn.ensemble.HistGradientBoostingRegressor.html#sklearn.ensemble.HistGradientBoostingRegressor is the equivalent to the link on For me the two (main and PR) look the same :-/ ![]() The element that is highlighted in the screenshot is the one that the fragment in the URL refers to. At least I think so. I think the browser (Firefox in this case) is doing the correct thing, it made sure the top of the element is within the viewing area but, there is something on top of it (the menu bar). I think the only way to fix this is to "make the element bigger" so that having the top of it in the viewable area means the actual content is far enough away from the top so that the menu doesn't cover it. Maybe there is a way to tell the browser that the menu is covering up the element and that it needs to scroll more to make it visible? I don't know how to "make the element bigger" :-/ Adding margin to it doesn't help and we don't want to increase the padding. What does seem to "just work" is https://output.circle-artifacts.com/output/job/b11ccb31-7f7e-44e7-8ae2-f591cbd412fe/artifacts/0/doc/modules/generated/sklearn.ensemble.HistGradientBoostingRegressor.html#sklearn-ensemble-histgradientboostingregressor (dashes in the ID instead of dots). Maybe the solution is to link to that instead? Joy, HTML and CSS trickery :D |
I updated this PR to be simpler. mainPR (Does not apply anymore) |
As a compromise, I updated the PR again to reduce the whitespace in the H1 tag. This is around the same space between the actual text and the navbar as the bootstrap site |
Hi @thomasjpfan If you really feel bad about the space above the first h1 which makes that it is no longer aligned with the top of the page, I would suggest to use the ":first-of-type" to reduce the space only for the first h1. Another, maybe even better option, would be to add vertical only on h1 that are "general siblings" of the enclosing div, using the "~" selector, which will not apply to the h1 right are the beginning of the div. I would however argue that even on the first h1, a bit of vertical space is good. |
I sent a PR here thomasjpfan#121 to suggest a way to go in your direction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you for the constructive back-and-forth @thomasjpfan
I believe that this is ready for merge. @betatim , do you want to have a last look? Without reply from you in a few days, I will merge, as I think that you were OK with the changes. |
I'm merging this: I worry that if we wait too long it is going to get lost in the weeds (I myself had a hard time finding it amongst all the opened PRs). |
Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
There is too much spacing above the sections and CSS for making section links visible does not work anymore. (Maybe something changed with newer versions of Sphinx)Onmain
, there is too much whitespace above the sections. This PR fixes the spacing.This PR keeps the whitespace introduce by #26625. The difference is the white-space above the first section is reduced.
main
PR