Skip to content

Fix nojs style issues #82947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/librustdoc/html/static/noscript.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ rules.
#main .impl-items .hidden {
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;
}
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ h4 > .notable-traits {
@media (min-width: 701px) {
/* 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.
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. */
.information:first-child > .tooltip {
margin-top: 16px;
Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc-gui/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ pub fn foo() {}
/// Just a normal struct.
pub struct Foo;

impl Foo {
#[must_use]
pub fn must_use(&self) -> bool { true }
}

/// Just a normal enum.
pub enum WhoLetTheDogOut {
/// Woof!
Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc-gui/nojs-attr-pos.goml
Original file line number Diff line number Diff line change
@@ -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"})