-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Using font size greater than 16 cause docs to render oddly #93171
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
Same behavior in Chrome too if you change the Font Size setting to anything higher then "medium" |
That might be related to #92448, which changed our font sizes from Do you see this on all crates, or just recently built crates? |
@jsha Indeed, this seems to only happens on newer crates. Even older version of a crate in problem will display properly, but the most recent one has the problem(ex: https://docs.rs/axum/0.2.4/axum/index.html is fine, but https://docs.rs/axum/latest/axum/index.html has the problem. |
A little quick investigation shows this is because the Setting |
Also, unchecking the |
@cynecx in your PR fixing the sidebar to use flexbox (thanks for that!), you had:
Do you happen to remember why you set min-width: 0? |
Yeah I agree, I don't think that's the proper fix.
I don't quite remember but I think it was because flex child elements have But I don't think that's the proper fix here. If we look at the flex container: We can see that the flexbox container isn't utilizing the whole width (because it hasn't been set!). So perhaps the proper fix would be to make the flex container |
I propose |
@jsha transferred |
@cynecx The Here's another possible fix: set What I like about this solution is it doesn't layer tweaks on top of tweaks. Instead, it's adding back in something explicit that docs.rs was implicitly depending on, but that it shouldn't have been. |
This is fixed in rust-lang/docs.rs#1614. |
Since this fix won't retroactively apply to old docs, if anyone else runs into this thread, here's a ublock origin filter that has worked for me: docs.rs###rustdoc_body_wrapper:style(width: 100% !important;) (Coincidentally it uses the same hack-fix as cynecx mentioned) I should note that I observe this issue for non-font reasons (I believe, inspector could be lying to me about font calculations) due to the fact I always view docs in a vertical window (half split (left/right) of a 1080p monitor). And here's also an untested attempt at using built-in firefox userstyles: @-moz-document domain(docs.rs) {
#rustdoc_body_wrapper {
width: 100% !important;
}
} (how to use if you're not familiar with userstyles) And if you want to check if it works, here's a crate+version which is affected. Edit: I should note that my issue isn't fixed by the font fix (which I believe(?) is present on the latest docs.rs crate builds), but I didn't actually find much useful info to recreate. It could be an issue with desktop vs mobile detection CSS rules or something similar as that tends to be the issue (sites not supporting vertical desktop view is frustratingly common, unfortunately). All I've got is that it's firefox only. I can make an issue if someone lets me know what the preferred repo for such an issue would be. |
Changing default font size from 16 to 17 on Firefox makes docs.rs page to render oddly.
Default font size: 17
Default font size: 16
The text was updated successfully, but these errors were encountered: