Skip to content
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

Set explicit font size for topbar #1614

Merged
merged 1 commit into from
Jan 22, 2022
Merged

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Jan 22, 2022

Fixes rust-lang/rust#93171.

Explanation: Since rust-lang/rust#92448, the docs.rs topbar will misbehave when the user's font size is >16px. Some items in the navbar will overflow their allotted height of 33px. This wasn't happening before because the navbar was inheriting rustdoc's styles on the <body> element, which included font-size: 16px. It turns out docs.rs was implicitly relying on that font-size: 16px, so add it here explicitly.

To test: Set your browser font-size to anything >16px. Visit a documentation page. It should have the normal width.

/cc @cynecx @GuillaumeGomez @syphar

Copy link
Member

@syphar syphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manual test is fine,

@GuillaumeGomez could you review the impl?

@syphar syphar added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jan 22, 2022
@syphar syphar merged commit b4291d4 into rust-lang:master Jan 22, 2022
@GuillaumeGomez
Copy link
Member

Looks good to me, just one question: did this issue appear after a specific rustdoc version? If so, please do like #1579.

@syphar
Copy link
Member

syphar commented Jan 22, 2022

Looks good to me, just one question: did this issue appear after a specific rustdoc version? If so, please do like #1579.

@jsha could you check this?

I'll wait with deploying until we know more

@syphar syphar added S-waiting-on-author Status: This PR is incomplete or needs to address review comments S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Jan 22, 2022
@jyn514
Copy link
Member

jyn514 commented Jan 22, 2022

My understanding is that before the new CSS version, rustdoc specified 16px itself. So docs.rs specifying it again won't change anything, and adding a new copy of the docs.rs CSS just for this seems like overkill.

@jsha
Copy link
Contributor Author

jsha commented Jan 22, 2022

Yes, @jyn514 has it exactly right. The problem appeared after a specfic rustdoc version, but it's safe and correct to apply this style with all rustdoc versions, so we shouldn't split off a new copy of the CSS for it.

@jsha jsha deleted the topbar-font-size branch January 22, 2022 17:59
@syphar syphar removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it labels Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using font size greater than 16 cause docs to render oddly
4 participants