Skip to content

Commit dc07e1b

Browse files
authored
Rollup merge of #105320 - notriddle:notriddle/rustdoc-toggle-hideme-2, r=GuillaumeGomez
rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles This code uses a special `hideme` class anyway, so just style that.
2 parents c699b05 + 32765fb commit dc07e1b

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/librustdoc/html/static/css/rustdoc.css

+2-9
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ h1, h2, h3, h4, h5, h6,
195195
span.since,
196196
a.srclink,
197197
#help-button > a,
198-
details.rustdoc-toggle.top-doc > summary,
199-
details.rustdoc-toggle.non-exhaustive > summary,
198+
summary.hideme,
200199
.scraped-example-list,
201200
/* This selector is for the items listed in the "all items" page. */
202201
ul.all-items {
@@ -1484,6 +1483,7 @@ details.rustdoc-toggle {
14841483
"Expand description" or "Show methods". */
14851484
details.rustdoc-toggle > summary.hideme {
14861485
cursor: pointer;
1486+
font-size: 1rem;
14871487
}
14881488

14891489
details.rustdoc-toggle > summary {
@@ -1546,13 +1546,6 @@ details.rustdoc-toggle > summary:focus-visible::before {
15461546
outline-offset: 1px;
15471547
}
15481548

1549-
details.rustdoc-toggle.top-doc > summary,
1550-
details.rustdoc-toggle.top-doc > summary::before,
1551-
details.rustdoc-toggle.non-exhaustive > summary,
1552-
details.rustdoc-toggle.non-exhaustive > summary::before {
1553-
font-size: 1rem;
1554-
}
1555-
15561549
details.non-exhaustive {
15571550
margin-bottom: 8px;
15581551
}

src/test/rustdoc-gui/enum-variants.goml

+5
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ goto: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html"
33

44
assert-css: (".variants > .variant", {"margin": "0px 0px 12px"})
55
assert-css: (".variants > .docblock", {"margin": "0px 0px 32px 24px"})
6+
7+
assert-css: (
8+
"details.non-exhaustive > summary",
9+
{"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},
10+
)

src/test/rustdoc-gui/src/test_docs/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ impl AsRef<str> for Foo {
7676
///
7777
/// # title!
7878
#[doc(alias = "ThisIsAnAlias")]
79+
#[non_exhaustive]
7980
pub enum WhoLetTheDogOut {
8081
/// Woof!
8182
Woof,

src/test/rustdoc-gui/toggle-docs.goml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ wait-for: 50
77
// This is now collapsed so there shouldn't be the "open" attribute on details.
88
assert-attribute-false: ("#main-content > details.top-doc", {"open": ""})
99
assert-text: ("#toggle-all-docs", "[+]")
10+
assert-css: (
11+
"#main-content > details.top-doc > summary",
12+
{"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},
13+
)
1014
click: "#toggle-all-docs"
1115
// Not collapsed anymore so the "open" attribute should be back.
1216
wait-for-attribute: ("#main-content > details.top-doc", {"open": ""})

0 commit comments

Comments
 (0)