Skip to content

Commit

Permalink
Rollup merge of #106996 - notriddle:notriddle/settings-line-div, r=Gu…
Browse files Browse the repository at this point in the history
…illaumeGomez

rustdoc: instead of `.setting-name { width: 100% }`, use default div CSS

This has no discernible change in appearance.
  • Loading branch information
matthiaskrgr authored Jan 18, 2023
2 parents c96dac1 + a242a2c commit f547bb5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
padding-bottom: 1px;
}

.radio-line .setting-name {
width: 100%;
}

.radio-line .choice {
margin-top: 0.1em;
margin-bottom: 0.1em;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
// This is a select setting.
output += `\
<div class="radio-line" id="${js_data_name}">
<span class="setting-name">${setting_name}</span>
<div class="setting-name">${setting_name}</div>
<div class="choices">`;
onEach(setting["options"], option => {
const checked = option === setting["default"] ? " checked" : "";
Expand Down
27 changes: 27 additions & 0 deletions tests/rustdoc-gui/settings.goml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,33 @@ assert-css: (
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
},
)
// Now we check the setting-name for radio buttons is on a different line than the label.
compare-elements-position-near: (
"#theme .setting-name",
"#theme .choices",
{"x": 1}
)
compare-elements-position-near-false: (
"#theme .setting-name",
"#theme .choices",
{"y": 1}
)
// Now we check that the label positions are all on the same line.
compare-elements-position-near: (
"#theme .choices #theme-light",
"#theme .choices #theme-dark",
{"y": 1}
)
compare-elements-position-near: (
"#theme .choices #theme-dark",
"#theme .choices #theme-ayu",
{"y": 1}
)
compare-elements-position-near: (
"#theme .choices #theme-ayu",
"#theme .choices #theme-system-preference",
{"y": 1}
)

// First we check the "default" display for toggles.
assert-css: (
Expand Down

0 comments on commit f547bb5

Please sign in to comment.