rustdoc: add CSS margin between impl docblock and its items

This commit is contained in:
Michael Howell 2022-12-13 16:55:45 -07:00
parent 0f529f0f49
commit 79bb6ec9ef
3 changed files with 18 additions and 0 deletions

View File

@ -1872,6 +1872,7 @@ in storage.js
}
.variants > .docblock,
.implementors-toggle > .docblock,
.impl-items > .rustdoc-toggle[open]:not(:last-child),
.methods > .rustdoc-toggle[open]:not(:last-child),
.implementors-toggle[open]:not(:last-child) {

View File

@ -0,0 +1,9 @@
// A docblock on an impl must have a margin to separate it from the contents.
goto: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithImplDoc.html"
// The text is about 24px tall, so if there's a margin, then their position will be >24px apart
compare-elements-position-near-false: (
"#implementations-list > .implementors-toggle > .docblock > p",
"#implementations-list > .implementors-toggle > .impl-items",
{"y": 24}
)

View File

@ -442,3 +442,11 @@ pub mod trait_members {
fn function2() {}
}
}
pub struct TypeWithImplDoc;
/// impl doc
impl TypeWithImplDoc {
/// fn doc
pub fn test_fn() {}
}