Skip to content

Commit

Permalink
Fix mobile doc display
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 6, 2018
1 parent c802e13 commit ded0bf5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4098,12 +4098,13 @@ impl<'a> fmt::Display for Sidebar<'a> {
</div>",
version)?;
}
}

write!(fmt, "<div class=\"sidebar-elems\">")?;
if it.is_crate() {
write!(fmt, "<a id='all-types' href='all.html'><p>See all {}'s items</p></a>",
it.name.as_ref().expect("crates always have a name"))?;
}

write!(fmt, "<div class=\"sidebar-elems\">")?;
match it.inner {
clean::StructItem(ref s) => sidebar_struct(fmt, it, s)?,
clean::TraitItem(ref t) => sidebar_trait(fmt, it, t)?,
Expand Down
37 changes: 24 additions & 13 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,9 @@ span.since {
padding-top: 0px;
}

.sidebar {
body > .sidebar {
height: 45px;
min-height: 40px;
width: calc(100% + 30px);
margin: 0;
margin-left: -15px;
padding: 0 15px;
Expand Down Expand Up @@ -1014,6 +1013,10 @@ span.since {
.anchor {
display: none !important;
}

h1.fqn {
overflow: initial;
}
}

@media print {
Expand Down Expand Up @@ -1113,6 +1116,18 @@ h4 > .important-traits {
top: 2px;
}

#all-types {
text-align: center;
border: 1px solid;
margin: 0 10px;
margin-bottom: 10px;
display: block;
border-radius: 7px;
}
#all-types > p {
margin: 5px 0;
}

@media (max-width: 700px) {
h4 > .important-traits {
position: absolute;
Expand All @@ -1136,6 +1151,9 @@ h4 > .important-traits {
background-color: rgba(0,0,0,0);
height: 100%;
}
.sidebar {
width: calc(100% + 30px);
}

.show-it {
display: block;
Expand Down Expand Up @@ -1181,6 +1199,10 @@ h4 > .important-traits {
.impl > .collapse-toggle {
left: -10px;
}

#all-types {
margin: 10px;
}
}


Expand Down Expand Up @@ -1384,17 +1406,6 @@ kbd {
#main > ul > li {
list-style: none;
}
#all-types {
text-align: center;
border: 1px solid;
margin: 0 10px;
margin-bottom: 10px;
display: block;
border-radius: 7px;
}
#all-types > p {
margin: 5px 0;
}

.non-exhaustive {
margin-bottom: 1em;
Expand Down

0 comments on commit ded0bf5

Please sign in to comment.