Skip to content

Commit 7c78ea5

Browse files
Fix display of toggles on mobile
1 parent b77830d commit 7c78ea5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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)