Skip to content

Commit

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

rustdoc: clean up `settings.css`

An identical CSS rule was merged for settings-check, and an unneeded `position: relative` removed.
  • Loading branch information
Dylan-DPC authored May 23, 2023
2 parents 6583025 + 24913bd commit 32c73c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/librustdoc/html/static/css/settings.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.setting-line {
margin: 1.2em 0.6em;
position: relative;
}

.setting-radio input, .setting-check input {
Expand All @@ -15,11 +14,6 @@
.setting-radio input {
border-radius: 50%;
}
.setting-check input:checked {
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">\
<path d="M7,25L17,32L33,12" fill="none" stroke="black" stroke-width="5"/>\
<path d="M7,23L17,30L33,10" fill="none" stroke="white" stroke-width="5"/></svg>');
}

.setting-radio span, .setting-check span {
padding-bottom: 1px;
Expand Down Expand Up @@ -52,6 +46,9 @@
.setting-check input:checked {
background-color: var(--settings-input-color);
border-width: 1px;
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">\
<path d="M7,25L17,32L33,12" fill="none" stroke="black" stroke-width="5"/>\
<path d="M7,23L17,30L33,10" fill="none" stroke="white" stroke-width="5"/></svg>');
}
.setting-radio input:focus, .setting-check input:focus {
box-shadow: 0 0 1px 1px var(--settings-input-color);
Expand Down
4 changes: 2 additions & 2 deletions tests/rustdoc-gui/settings.goml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ wait-for-css: ("#help-button .popover", {"display": "block"})
// Now we go to the settings page to check that the CSS is loaded as expected.
go-to: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
assert-css: (".setting-line", {"position": "relative"})
assert-css: (".setting-radio", {"cursor": "pointer"})

assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS)
compare-elements-position: (".sub form", "#settings", ("x"))
Expand All @@ -322,4 +322,4 @@ reload:
set-window-size: (300, 1000)
click: "#settings-menu"
wait-for: "#settings"
assert-css: (".setting-line", {"position": "relative"})
assert-css: (".setting-radio", {"cursor": "pointer"})

0 comments on commit 32c73c2

Please sign in to comment.