Skip to content
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

rustdoc: remove old CSS selector that causes weird spacing #101335

Merged
merged 3 commits into from
Sep 3, 2022
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
13 changes: 5 additions & 8 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -778,14 +778,6 @@ pre, .rustdoc.source .example-wrap {
margin-bottom: .6em;
}

.content .impl-items > .item-info {
margin-left: 40px;
}

.methods > .item-info, .content .impl-items > .item-info {
margin-top: -8px;
}

.impl-items {
flex-basis: 100%;
}
Expand Down Expand Up @@ -2015,6 +2007,11 @@ in storage.js plus the media query with (min-width: 701px)
#main-content > div > details.rustdoc-toggle > summary::before {
left: -11px;
}

/* Align summary-nested and unnested item-info gizmos. */
.content .impl-items > .item-info {
margin-left: 34px;
}
}

@media print {
Expand Down
10 changes: 10 additions & 0 deletions src/test/rustdoc-gui/item-info-alignment.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This test ensures that the "item-info" looks about the same
// whether or not it's inside a toggle.
goto: file://|DOC_PATH|/lib2/struct.ItemInfoAlignmentTest.html

// First, we try it in "desktop" mode.
size: (1200, 870)
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
// Next, we try it in "mobile" mode (max-width: 700px).
size: (650, 650)
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
10 changes: 10 additions & 0 deletions src/test/rustdoc-gui/src/lib2/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,13 @@ where
type Output;
fn index(&self, index: Idx) -> &Self::Output;
}

pub struct ItemInfoAlignmentTest;

impl ItemInfoAlignmentTest {
/// This method has docs
#[deprecated]
pub fn foo() {}
#[deprecated]
pub fn bar() {}
}