mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-19 03:54:40 +00:00
Rollup merge of #103364 - notriddle:notriddle/toggles, r=jsha
rustdoc: clean up rustdoc-toggle CSS
This commit is contained in:
commit
66f33dff2d
@ -1536,6 +1536,7 @@ details.dir-entry a {
|
|||||||
https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
|
https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
|
||||||
details.rustdoc-toggle {
|
details.rustdoc-toggle {
|
||||||
contain: layout;
|
contain: layout;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The hideme class is used on summary tags that contain a span with
|
/* The hideme class is used on summary tags that contain a span with
|
||||||
@ -1629,10 +1630,6 @@ details.rustdoc-toggle[open] > summary.hideme {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
details.rustdoc-toggle {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
details.rustdoc-toggle[open] > summary.hideme > span {
|
details.rustdoc-toggle[open] > summary.hideme > span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -1983,8 +1980,8 @@ in storage.js
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.method-toggle summary,
|
.method-toggle > summary,
|
||||||
.implementors-toggle summary,
|
.implementors-toggle > summary,
|
||||||
.impl,
|
.impl,
|
||||||
#implementors-list > .docblock,
|
#implementors-list > .docblock,
|
||||||
.impl-items > section,
|
.impl-items > section,
|
||||||
@ -1993,10 +1990,7 @@ in storage.js
|
|||||||
margin-bottom: 0.75em;
|
margin-bottom: 0.75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method-toggle[open]:not(:last-child) {
|
.method-toggle[open]:not(:last-child),
|
||||||
margin-bottom: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.implementors-toggle[open]:not(:last-child) {
|
.implementors-toggle[open]:not(:last-child) {
|
||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
}
|
}
|
||||||
|
@ -21,3 +21,14 @@ assert-property: (".top-doc .docblock summary h4", {"offsetHeight": "33"})
|
|||||||
assert-css: (".top-doc .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
|
assert-css: (".top-doc .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
|
||||||
// So `33 + 15 + 5` == `53`
|
// So `33 + 15 + 5` == `53`
|
||||||
assert-property: (".top-doc .docblock summary", {"offsetHeight": "53"})
|
assert-property: (".top-doc .docblock summary", {"offsetHeight": "53"})
|
||||||
|
|
||||||
|
// We now check the `<summary>` on a method.
|
||||||
|
assert-css: (
|
||||||
|
".method-toggle .docblock summary h4",
|
||||||
|
{"border-bottom-width": "0px"},
|
||||||
|
)
|
||||||
|
// This allows to ensure that summary is on one line only!
|
||||||
|
assert-property: (".method-toggle .docblock summary h4", {"offsetHeight": "30"})
|
||||||
|
assert-css: (".method-toggle .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
|
||||||
|
// So `30 + 15 + 5` == `50`
|
||||||
|
assert-property: (".method-toggle .docblock summary", {"offsetHeight": "50"})
|
||||||
|
@ -317,6 +317,18 @@ pub mod details {
|
|||||||
/// <div>I'm the content of the details!</div>
|
/// <div>I'm the content of the details!</div>
|
||||||
/// </details>
|
/// </details>
|
||||||
pub struct Details;
|
pub struct Details;
|
||||||
|
|
||||||
|
impl Details {
|
||||||
|
/// We check the appearance of the `<details>`/`<summary>` in here.
|
||||||
|
///
|
||||||
|
/// ## Hello
|
||||||
|
///
|
||||||
|
/// <details>
|
||||||
|
/// <summary><h4>I'm a summary</h4></summary>
|
||||||
|
/// <div>I'm the content of the details!</div>
|
||||||
|
/// </details>
|
||||||
|
pub fn method() {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod doc_block_table {
|
pub mod doc_block_table {
|
||||||
|
Loading…
Reference in New Issue
Block a user