Skip to content

Commit 2da54c7

Browse files
authored
Rollup merge of #92440 - GuillaumeGomez:fix-mobile-toggles, r=jsha
Fix mobile toggles position Before: ![Screenshot from 2021-12-29 18-53-33](https://user-images.githubusercontent.com/3050060/147764842-082f6fa2-b631-4c47-ba34-ced76fe8494f.png) After: ![Screenshot from 2021-12-29 18-52-48](https://user-images.githubusercontent.com/3050060/147764853-13046330-2442-4fad-b26a-84c167711b54.png) r? `@jsha`
2 parents 4e4d258 + 7c78ea5 commit 2da54c7

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

Diff for: src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
7272
# https://github.com/puppeteer/puppeteer/issues/375
7373
#
7474
# We also specify the version in case we need to update it to go around cache limitations.
75-
RUN npm install -g [email protected].1 --unsafe-perm=true
75+
RUN npm install -g [email protected].3 --unsafe-perm=true
7676

7777
ENV RUST_CONFIGURE_ARGS \
7878
--build=x86_64-unknown-linux-gnu \

Diff for: src/librustdoc/html/static/css/rustdoc.css

+10
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,16 @@ details.rustdoc-toggle[open] > summary.hideme::after {
20072007
max-width: 100vw;
20082008
width: 100vw;
20092009
}
2010+
2011+
/* Position of the "[-]" element. */
2012+
details.rustdoc-toggle:not(.top-doc) > summary {
2013+
margin-left: 10px;
2014+
}
2015+
.impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
2016+
#main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
2017+
#main-content > div > details.rustdoc-toggle > summary::before {
2018+
left: -11px;
2019+
}
20102020
}
20112021

20122022
@media print {

Diff for: src/test/rustdoc-gui/toggle-docs-mobile.goml

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ assert-attribute: (".top-doc", {"open": ""})
99
click: (3, 280)
1010
assert-attribute: (".top-doc", {"open": ""})
1111

12+
// Assert the position of the toggle on the top doc block.
13+
assert-position: (".top-doc summary::before", {"x": 4})
14+
// Assert the position of the toggle on the impl block.
15+
assert-position: ("#implementations + details > summary::before", {"x": 4})
16+
// Assert the position of the toggle on a method.
17+
assert-position: (
18+
"#trait-implementations-list .impl-items .method-toggle > summary::before",
19+
{"x": 4},
20+
)
21+
1222
// Now we do the same but with a little bigger width
1323
size: (600, 600)
1424
assert-attribute: (".top-doc", {"open": ""})

0 commit comments

Comments
 (0)