File tree 3 files changed +42
-2
lines changed
librustdoc/html/static/css
3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -158,8 +158,8 @@ h1.fqn {
158
158
Underlines elsewhere in the documentation break up visual flow and tend to invert
159
159
section hierarchies. */
160
160
h2 ,
161
- .top-doc h3 ,
162
- .top-doc h4 {
161
+ .top-doc . docblock > h3 ,
162
+ .top-doc . docblock > h4 {
163
163
border-bottom : 1px solid;
164
164
}
165
165
h3 .code-header {
@@ -1681,6 +1681,11 @@ details.rustdoc-toggle[open] > summary.hideme::after {
1681
1681
content : "Collapse" ;
1682
1682
}
1683
1683
1684
+ /* This is needed in docblocks to have the "▶" element to be on the same line. */
1685
+ .docblock summary > * {
1686
+ display : inline-block;
1687
+ }
1688
+
1684
1689
/* Media Queries */
1685
1690
1686
1691
@media (min-width : 701px ) {
Original file line number Diff line number Diff line change
1
+ // This ensures that the `<details>`/`<summary>` elements are displayed as expected.
2
+ goto: file://|DOC_PATH|/test_docs/details/struct.Details.html
3
+ show-text: true
4
+ local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
5
+ reload:
6
+
7
+ // We first check that the headers in the `.top-doc` doc block still have their
8
+ // bottom border.
9
+ assert-text: (".top-doc .docblock > h3", "Hello")
10
+ assert-css: (
11
+ ".top-doc .docblock > h3",
12
+ {"border-bottom": "1px solid rgb(221, 221, 221)"},
13
+ )
14
+ // We now check that the `<summary>` doesn't have a bottom border and has the correct display.
15
+ assert-css: (
16
+ ".top-doc .docblock summary h4",
17
+ {"border-bottom": "0px none rgb(221, 221, 221)"},
18
+ )
19
+ // This allows to ensure that summary is on one line only!
20
+ assert-property: (".top-doc .docblock summary h4", {"offsetHeight": "33"})
21
+ assert-css: (".top-doc .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
22
+ // So `33 + 15 + 5` == `53`
23
+ assert-property: (".top-doc .docblock summary", {"offsetHeight": "53"})
Original file line number Diff line number Diff line change @@ -277,3 +277,15 @@ pub use macros::*;
277
277
278
278
#[ doc( alias = "AliasForTheStdReexport" ) ]
279
279
pub use :: std as TheStdReexport ;
280
+
281
+ pub mod details {
282
+ /// We check the appearance of the `<details>`/`<summary>` in here.
283
+ ///
284
+ /// ## Hello
285
+ ///
286
+ /// <details>
287
+ /// <summary><h4>I'm a summary</h4></summary>
288
+ /// <div>I'm the content of the details!</div>
289
+ /// </details>
290
+ pub struct Details ;
291
+ }
You can’t perform that action at this time.
0 commit comments