Skip to content

Commit f547bb5

Browse files
authored
Rollup merge of #106996 - notriddle:notriddle/settings-line-div, r=GuillaumeGomez
rustdoc: instead of `.setting-name { width: 100% }`, use default div CSS This has no discernible change in appearance.
2 parents c96dac1 + a242a2c commit f547bb5

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

src/librustdoc/html/static/css/settings.css

-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
padding-bottom: 1px;
3434
}
3535

36-
.radio-line .setting-name {
37-
width: 100%;
38-
}
39-
4036
.radio-line .choice {
4137
margin-top: 0.1em;
4238
margin-bottom: 0.1em;

src/librustdoc/html/static/js/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
// This is a select setting.
136136
output += `\
137137
<div class="radio-line" id="${js_data_name}">
138-
<span class="setting-name">${setting_name}</span>
138+
<div class="setting-name">${setting_name}</div>
139139
<div class="choices">`;
140140
onEach(setting["options"], option => {
141141
const checked = option === setting["default"] ? " checked" : "";

tests/rustdoc-gui/settings.goml

+27
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,33 @@ assert-css: (
105105
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
106106
},
107107
)
108+
// Now we check the setting-name for radio buttons is on a different line than the label.
109+
compare-elements-position-near: (
110+
"#theme .setting-name",
111+
"#theme .choices",
112+
{"x": 1}
113+
)
114+
compare-elements-position-near-false: (
115+
"#theme .setting-name",
116+
"#theme .choices",
117+
{"y": 1}
118+
)
119+
// Now we check that the label positions are all on the same line.
120+
compare-elements-position-near: (
121+
"#theme .choices #theme-light",
122+
"#theme .choices #theme-dark",
123+
{"y": 1}
124+
)
125+
compare-elements-position-near: (
126+
"#theme .choices #theme-dark",
127+
"#theme .choices #theme-ayu",
128+
{"y": 1}
129+
)
130+
compare-elements-position-near: (
131+
"#theme .choices #theme-ayu",
132+
"#theme .choices #theme-system-preference",
133+
{"y": 1}
134+
)
108135

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

0 commit comments

Comments
 (0)