Skip to content

Commit f5869ef

Browse files
authored
Rollup merge of rust-lang#54869 - GuillaumeGomez:fix-mobile-docs, r=QuietMisdreavus
Fix mobile docs Fixes rust-lang#54836. <img width="1440" alt="screen shot 2018-10-06 at 18 53 19" src="https://user-images.githubusercontent.com/3050060/46573683-1b4cd700-c999-11e8-9e6b-86a23b332e22.png"> r? @QuietMisdreavus
2 parents 83cc5a0 + ded0bf5 commit f5869ef

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

src/Cargo.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
12691269

12701270
[[package]]
12711271
name = "minifier"
1272-
version = "0.0.19"
1272+
version = "0.0.20"
12731273
source = "registry+https://github.com/rust-lang/crates.io-index"
12741274
dependencies = [
12751275
"macro-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2484,7 +2484,7 @@ dependencies = [
24842484
name = "rustdoc"
24852485
version = "0.0.0"
24862486
dependencies = [
2487-
"minifier 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
2487+
"minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)",
24882488
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
24892489
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
24902490
"tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3289,7 +3289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32893289
"checksum memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a3b4142ab8738a78c51896f704f83c11df047ff1bda9a92a661aa6361552d93d"
32903290
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
32913291
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
3292-
"checksum minifier 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "9908ed7c62f990c21ab41fdca53a864a3ada0da69d8729c4de727b397e27bc11"
3292+
"checksum minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "96c269bb45c39b333392b2b18ad71760b34ac65666591386b0e959ed58b3f474"
32933293
"checksum miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "609ce024854aeb19a0ef7567d348aaa5a746b32fb72e336df7fcc16869d7e2b4"
32943294
"checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226"
32953295
"checksum new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cdc457076c78ab54d5e0d6fa7c47981757f1e34dc39ff92787f217dede586c4"

src/librustdoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ path = "lib.rs"
99

1010
[dependencies]
1111
pulldown-cmark = { version = "0.1.2", default-features = false }
12-
minifier = "0.0.19"
12+
minifier = "0.0.20"
1313
tempfile = "3"
1414
parking_lot = "0.6.4"

src/librustdoc/html/render.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -4098,12 +4098,13 @@ impl<'a> fmt::Display for Sidebar<'a> {
40984098
</div>",
40994099
version)?;
41004100
}
4101+
}
41014102

4103+
write!(fmt, "<div class=\"sidebar-elems\">")?;
4104+
if it.is_crate() {
41024105
write!(fmt, "<a id='all-types' href='all.html'><p>See all {}'s items</p></a>",
41034106
it.name.as_ref().expect("crates always have a name"))?;
41044107
}
4105-
4106-
write!(fmt, "<div class=\"sidebar-elems\">")?;
41074108
match it.inner {
41084109
clean::StructItem(ref s) => sidebar_struct(fmt, it, s)?,
41094110
clean::TraitItem(ref t) => sidebar_trait(fmt, it, t)?,

src/librustdoc/html/static/rustdoc.css

+24-13
Original file line numberDiff line numberDiff line change
@@ -908,10 +908,9 @@ span.since {
908908
padding-top: 0px;
909909
}
910910

911-
.sidebar {
911+
body > .sidebar {
912912
height: 45px;
913913
min-height: 40px;
914-
width: calc(100% + 30px);
915914
margin: 0;
916915
margin-left: -15px;
917916
padding: 0 15px;
@@ -1013,6 +1012,10 @@ span.since {
10131012
.anchor {
10141013
display: none !important;
10151014
}
1015+
1016+
h1.fqn {
1017+
overflow: initial;
1018+
}
10161019
}
10171020

10181021
@media print {
@@ -1112,6 +1115,18 @@ h4 > .important-traits {
11121115
top: 2px;
11131116
}
11141117

1118+
#all-types {
1119+
text-align: center;
1120+
border: 1px solid;
1121+
margin: 0 10px;
1122+
margin-bottom: 10px;
1123+
display: block;
1124+
border-radius: 7px;
1125+
}
1126+
#all-types > p {
1127+
margin: 5px 0;
1128+
}
1129+
11151130
@media (max-width: 700px) {
11161131
h4 > .important-traits {
11171132
position: absolute;
@@ -1135,6 +1150,9 @@ h4 > .important-traits {
11351150
background-color: rgba(0,0,0,0);
11361151
height: 100%;
11371152
}
1153+
.sidebar {
1154+
width: calc(100% + 30px);
1155+
}
11381156

11391157
.show-it {
11401158
display: block;
@@ -1180,6 +1198,10 @@ h4 > .important-traits {
11801198
.impl > .collapse-toggle {
11811199
left: -10px;
11821200
}
1201+
1202+
#all-types {
1203+
margin: 10px;
1204+
}
11831205
}
11841206

11851207

@@ -1383,17 +1405,6 @@ kbd {
13831405
#main > ul > li {
13841406
list-style: none;
13851407
}
1386-
#all-types {
1387-
text-align: center;
1388-
border: 1px solid;
1389-
margin: 0 10px;
1390-
margin-bottom: 10px;
1391-
display: block;
1392-
border-radius: 7px;
1393-
}
1394-
#all-types > p {
1395-
margin: 5px 0;
1396-
}
13971408

13981409
.non-exhaustive {
13991410
margin-bottom: 1em;

0 commit comments

Comments
 (0)