Auto merge of #82947 - GuillaumeGomez:fix-nojs-style-issues, r=Nemo157
Fix nojs style issues There are two issues fixed here: 1. The position of "{version}" and "[src]" spans. 2. The position of attributes (on top of functions) Please note that these issues only happen if you have disabled javascript. Before:  After:  In the last commit, I added a test to enforce the attributes position. I need to think how to enforce it for the spans but that can comes later on. r? `@Nemo157`
This commit is contained in:
commit
ea16128233
4 changed files with 21 additions and 1 deletions
|
@ -23,3 +23,13 @@ rules.
|
||||||
#main .impl-items .hidden {
|
#main .impl-items .hidden {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#main .impl-items h4.hidden {
|
||||||
|
/* Without this rule, the version and the "[src]" span aren't on the same line as the header. */
|
||||||
|
display: flex !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .attributes {
|
||||||
|
/* Since there is no toggle (the "[-]") when JS is disabled, no need for this margin either. */
|
||||||
|
margin-left: 0 !important;
|
||||||
|
}
|
||||||
|
|
|
@ -1343,7 +1343,7 @@ h4 > .notable-traits {
|
||||||
@media (min-width: 701px) {
|
@media (min-width: 701px) {
|
||||||
/* In case there is no documentation before a code block, we need to add some margin at the top
|
/* In case there is no documentation before a code block, we need to add some margin at the top
|
||||||
to prevent an overlay between the "collapse toggle" and the information tooltip.
|
to prevent an overlay between the "collapse toggle" and the information tooltip.
|
||||||
However, it's needed needed with smaller screen width because the doc/code block is always put
|
However, it's not needed with smaller screen width because the doc/code block is always put
|
||||||
"one line" below. */
|
"one line" below. */
|
||||||
.information:first-child > .tooltip {
|
.information:first-child > .tooltip {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
|
|
|
@ -27,6 +27,11 @@ pub fn foo() {}
|
||||||
/// Just a normal struct.
|
/// Just a normal struct.
|
||||||
pub struct Foo;
|
pub struct Foo;
|
||||||
|
|
||||||
|
impl Foo {
|
||||||
|
#[must_use]
|
||||||
|
pub fn must_use(&self) -> bool { true }
|
||||||
|
}
|
||||||
|
|
||||||
/// Just a normal enum.
|
/// Just a normal enum.
|
||||||
pub enum WhoLetTheDogOut {
|
pub enum WhoLetTheDogOut {
|
||||||
/// Woof!
|
/// Woof!
|
||||||
|
|
5
src/test/rustdoc-gui/nojs-attr-pos.goml
Normal file
5
src/test/rustdoc-gui/nojs-attr-pos.goml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// Check that the attributes are well positioned when javascript is disabled (since
|
||||||
|
// there is no toggle to display)
|
||||||
|
javascript: false
|
||||||
|
goto: file://|DOC_PATH|/struct.Foo.html
|
||||||
|
assert: (".attributes", {"margin-left": "0px"})
|
Loading…
Add table
Add a link
Reference in a new issue