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

Fix item name display on mobile #79936

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Dec 11, 2020

@GuillaumeGomez GuillaumeGomez added A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 11, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 11, 2020

Can you post some screenshots of how this looks at various screen widths? Maybe with different lengths of the summary too?

@GuillaumeGomez
Copy link
Member Author

Absolutely! Didn't because I just realized that the bug for the input was back. Fixing it once again...

@GuillaumeGomez
Copy link
Member Author

Ok, added the screenshot and also a fix for the not-clickable search input: the issue was that under 416px width, the search input goes below "inside" the #main section. To fix it, I simply put down the #main so that it doesn't go over the input.

@jyn514
Copy link
Member

jyn514 commented Dec 12, 2020

@GuillaumeGomez pointed out to me that this only affects mobile, so I'm comfortable changing it even though it goes from min-width to width. It might be nice to implement #78799 at some point though.

I'd prefer for @Nemo157 to take a look at this before merging if possible, but otherwise LGTM.

@GuillaumeGomez
Copy link
Member Author

To add a bit more info: min-width was 10%. 10% of 416px (which is the up limit for this style to be applied) only makes 41px, which isn't much haha.

@poliorcetics
Copy link
Contributor

Screenshot 2020-12-12 at 15 56 13

Another way of doing this on small screens is to put the left-aligned name above the documentation:

**fn**
Function pointers, like `fn(usize) -> bool`.

This would avoid 3-words width, making it more readable (I think) on mobile/narrower pages.

@GuillaumeGomez
Copy link
Member Author

Hmmmm... I'm not sure to like the idea. Considering the idea here is mostly fixing the bug, I think this goes a bit beyond. Could you open an issue suggesting this and linking to this PR so we can discuss it please?

@@ -1569,9 +1569,13 @@ h4 > .notable-traits {
height: 73px;
}

#main {
margin-top: 100px;
Copy link
Member

@Nemo157 Nemo157 Dec 14, 2020

Choose a reason for hiding this comment

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

This results in quite a big blank area on desktop

Ignore me, I missed the media query.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was about to comment and ask how you were able to achieve that result. 🤣

Copy link
Member

Choose a reason for hiding this comment

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

Manually editing the css on doc.rust-lang.org wrong to test it 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Just in this case, generally it works. ;)

@Nemo157
Copy link
Member

Nemo157 commented Dec 14, 2020

LGTM

@GuillaumeGomez
Copy link
Member Author

@bors r=Nemo157,jyn514

@bors
Copy link
Contributor

bors commented Dec 14, 2020

📌 Commit 9c36491 has been approved by Nemo157,jyn514

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 14, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2020
…laumeGomez

Rollup of 3 pull requests

Successful merges:

 - rust-lang#79918 (doc(array,vec): add notes about side effects when empty-initializing)
 - rust-lang#79936 (Fix item name display on mobile)
 - rust-lang#80013 (Refactor test_lang_string_parse to make it clearer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 63e86a7 into rust-lang:master Dec 14, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 14, 2020
@GuillaumeGomez GuillaumeGomez deleted the mobile-fix-item-name branch December 14, 2020 16:17
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 2, 2021
…, r=jyn514

Fix search section position on small devices

Fixes rust-lang#79526.

This is exactly the same issue fixed in 9c36491 (in rust-lang#79936) but applied to the search section. When the width becomes too small, the search input goes on its own line to get more space, making it go "under" the section following (so either "main" or "search"). The fix is to simply make the section go more under so that it doesn't go over the search input.

r? `@jyn514`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(mobile) module item names are word-wrapped instead of narrowing the summary
6 participants