Skip to content

Tweak layout for elements on crate page to fix some small issues with narrow screens #568

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

Merged

Conversation

evestera
Copy link
Contributor

  • Add some margin to header nav/menu and mobile search field to keep them away from the edges.
  • Set flex-wrap: wrap on name/version heading to wrap rather than overflow (and potentially break layout) when the screen is too narrow. This approach is not the best-looking, but a lot better than doing nothing.
  • Add some margin to crate-links sections (Fixes Insufficient spacing between Dev-Dependencies and Versions #235 ).

Before:
screen shot 2017-02-22 at 22 09 58

After:
screen shot 2017-02-22 at 22 10 29

Before:
screen shot 2017-02-22 at 22 12 51

After:
screen shot 2017-02-22 at 22 13 11

For the #crate-links.section margin it also applies to the right-most element(s), which is not quite optimal. An alternative solution without this minor issue is shown below, but this unfortunately makes the gray divider line too long, so I've stuck with the simple solution.

--- a/app/styles/crate.scss
+++ b/app/styles/crate.scss
@@ -313,11 +313,14 @@
     padding-bottom: 20px;
     border-bottom: 5px solid $gray-border;
     margin-bottom: 30px;
+    margin-left: -5px;
+    margin-right: -5px;

     h3 { margin-bottom: 5px; }
     .section {
         @include flex(1);
-        margin-right: 10px;
+        padding-left: 5px;
+        padding-right: 5px;
         li { line-height: 24px; }
         .date { color: $main-color-light; padding-left: 5px; }
     }

@carols10cents
Copy link
Member

Cool!! Looking good, I should have some time to take a closer look at this and try it out tomorrow :)

@carols10cents
Copy link
Member

This looks great to me at a whole bunch of widths! There's still more to do, as always, but this is better than what it was before :) Thank you!!! 💯

@carols10cents carols10cents merged commit 4f9aeb3 into rust-lang:master Feb 24, 2017
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.

2 participants