Skip to content

Commit

Permalink
Rollup merge of #107045 - notriddle:notriddle/settings-css-setting-li…
Browse files Browse the repository at this point in the history
…ne, r=GuillaumeGomez

rustdoc: remove redundant CSS rule `#settings .setting-line`

Since the current version of settings.js always nests things below a div with ID `settings`, this rule always overrode the one above.
  • Loading branch information
compiler-errors authored Jan 18, 2023
2 parents 6595127 + 34d595d commit e12c6b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/librustdoc/html/static/css/settings.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.setting-line {
margin: 0.6em 0 0.6em 0.3em;
margin: 1.2em 0.6em;
position: relative;
}

Expand Down Expand Up @@ -55,10 +55,6 @@
cursor: pointer;
}

#settings .setting-line {
margin: 1.2em 0.6em;
}

.setting-line .radio-line input:checked {
box-shadow: inset 0 0 0 3px var(--main-background-color);
background-color: var(--settings-input-color);
Expand Down
7 changes: 7 additions & 0 deletions tests/rustdoc-gui/settings.goml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ assert-false: "#settings"
click: "#settings-menu"
wait-for: "#settings"
assert-css: ("#settings", {"display": "block"})

// Store the line margin to compare with the settings.html later.
store-css: (setting_line_margin, ".setting-line", "margin")

// Let's close it by clicking on the same button.
click: "#settings-menu"
wait-for-css: ("#settings", {"display": "none"})
Expand Down Expand Up @@ -230,6 +234,9 @@ assert-css: (".setting-line", {"position": "relative"})
assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS)
compare-elements-position: (".sub form", "#settings", ("x"))

// Check that setting-line has the same margin in this mode as in the popover.
assert-css: (".setting-line", {"margin": |setting_line_margin|})

// We now check the display with JS disabled.
assert-false: "noscript section"
javascript: false
Expand Down

0 comments on commit e12c6b2

Please sign in to comment.