Skip to content

Mobile: Opening rustdoc hamburger menu overlaps rustdoc header #1121

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

Closed
jsha opened this issue Oct 24, 2020 · 4 comments · Fixed by #1233
Closed

Mobile: Opening rustdoc hamburger menu overlaps rustdoc header #1121

jsha opened this issue Oct 24, 2020 · 4 comments · Fixed by #1233
Labels
A-rustdoc-css Area: CSS generated by rustdoc for documentation pages C-bug Category: This is a bug

Comments

@jsha
Copy link
Contributor

jsha commented Oct 24, 2020

Steps to reproduce:

  1. On a mobile device (or in Chrome's mobile simulation mode), visit a crate page, for instance https://docs.rs/ureq/1.5.1/ureq/index.html.
  2. Tap the hamburger menu in the top left.

Expected result:

Rustdoc's crate header is not obscured by the menu.

Actual result:

The header is obscured by the menu.

https://docs.rs/ureq/1.5.1/ureq/index.html

image

vs https://doc.rust-lang.org/std/vec/struct.Vec.html

image

(noticed while writing up #1120 )

@jyn514 jyn514 added A-rustdoc-css Area: CSS generated by rustdoc for documentation pages C-bug Category: This is a bug labels Oct 27, 2020
@arusahni
Copy link
Contributor

I've confirmed this problem still exists. Would it be an issue if I picked it up? The immediate fix (adjusting the top offset to use the correct math) seems fairly straightforward. However, there's some additional jank around opening the sidebar that causes the Rust logo and crate name to shift on open and close. Since I'd already be poking around in that element, I can investigate and fix that, too.

I'll take care to not go overboard as #1120 proposes something that could make this component not long for the world.

@jyn514
Copy link
Member

jyn514 commented Dec 31, 2020

@arusahni go for it :) this seems to be a docs.rs specific bug, so I'd start by finding why this is different from normal docs that rustdoc generates.

@arusahni
Copy link
Contributor

arusahni commented Dec 31, 2020

@jyn514 after some comparison, it boils down to it being because of the docs.rs shell. The sidebar is a fixed position element, with its top offset being 45px from the top. With rustdoc's output, that magic number is the height of the topbar. However this number is different for docs.rs due to the navbar - it's instead 45px + 32px (where the latter is the height of the docs.rs navbar).

EDIT: It appears that the selector for this element changed, so the override we had in place was no longer functional.

arusahni added a commit to arusahni/docs.rs that referenced this issue Jan 1, 2021
This corrects a bug where the CSS selcetor to reposition the top of the
rustdoc sidebar was no longer applied to the element. It also updates
the magic number to be less magic.

Fixes rust-lang#1121
@arusahni
Copy link
Contributor

arusahni commented Jan 1, 2021

These (and some Clippy warnings) are addressed in PR #1233.

arusahni added a commit to arusahni/docs.rs that referenced this issue Jan 1, 2021
This corrects a bug where the CSS selcetor to reposition the top of the
rustdoc sidebar was no longer applied to the element. It also updates
the magic number to be less magic.

Fixes rust-lang#1121
jyn514 pushed a commit that referenced this issue Jan 1, 2021
This corrects a bug where the CSS selcetor to reposition the top of the
rustdoc sidebar was no longer applied to the element. It also updates
the magic number to be less magic.

Fixes #1121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-css Area: CSS generated by rustdoc for documentation pages C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@arusahni @jsha @jyn514 and others