Fix mobile doc display

This commit is contained in:
Guillaume Gomez 2018-10-06 18:51:56 +02:00
parent ca517a6ee9
commit c5a025aae6
3 changed files with 31 additions and 19 deletions

View file

@ -4098,12 +4098,13 @@ impl<'a> fmt::Display for Sidebar<'a> {
</div>",
version)?;
}
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\">")?;
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"))?;
}
match it.inner {
clean::StructItem(ref s) => sidebar_struct(fmt, it, s)?,
clean::TraitItem(ref t) => sidebar_trait(fmt, it, t)?,

View file

@ -908,10 +908,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;
@ -1013,6 +1012,10 @@ span.since {
.anchor {
display: none !important;
}
h1.fqn {
overflow: initial;
}
}
@media print {
@ -1112,6 +1115,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;
@ -1135,6 +1150,9 @@ h4 > .important-traits {
background-color: rgba(0,0,0,0);
height: 100%;
}
.sidebar {
width: calc(100% + 30px);
}
.show-it {
display: block;
@ -1180,6 +1198,10 @@ h4 > .important-traits {
.impl > .collapse-toggle {
left: -10px;
}
#all-types {
margin: 10px;
}
}
@ -1383,17 +1405,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;