Skip to content

Commit e8d0fbf

Browse files
Improve display of settings radio buttons
1 parent bef2b7c commit e8d0fbf

File tree

5 files changed

+78
-31
lines changed

5 files changed

+78
-31
lines changed

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

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,40 @@
33
position: relative;
44
}
55

6-
.setting-line > div {
7-
display: inline-block;
8-
vertical-align: top;
9-
font-size: 17px;
10-
padding-top: 2px;
11-
}
12-
13-
.setting-line > .title {
14-
font-size: 19px;
15-
width: 100%;
16-
max-width: none;
17-
border-bottom: 1px solid;
18-
}
19-
20-
.setting-line .radio-line,
216
.setting-line .choices {
227
display: flex;
238
flex-wrap: wrap;
249
}
2510

26-
.setting-line .radio-line .setting-name {
27-
flex-grow: 1;
28-
margin-top: auto;
29-
margin-bottom: auto;
30-
}
31-
3211
.setting-line .radio-line input {
3312
margin-right: 0.3em;
13+
height: 1.2rem;
14+
width: 1.2rem;
15+
border: 1px solid;
16+
outline: none;
17+
-webkit-appearance: none;
18+
cursor: pointer;
19+
border-radius: 50%;
20+
}
21+
.setting-line .radio-line input + span {
22+
padding-bottom: 1px;
23+
}
24+
25+
.radio-line .setting-name {
26+
width: 100%;
3427
}
3528

3629
.radio-line .choice {
37-
border-radius: 0.1em;
38-
border: 1px solid;
39-
margin-left: 0.5em;
4030
margin-top: 0.1em;
4131
margin-bottom: 0.1em;
4232
min-width: 3.8em;
4333
padding: 0.3em;
34+
display: flex;
35+
align-items: center;
36+
cursor: pointer;
37+
}
38+
.radio-line .choice + .choice {
39+
margin-left: 0.5em;
4440
}
4541

4642
.toggle {

src/librustdoc/html/static/css/themes/ayu.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ body, #settings-menu #settings, #settings-menu #settings::before {
1010
color: #c5c5c5;
1111
}
1212

13+
.setting-line .radio-line input {
14+
border-color: #c5c5c5;
15+
}
16+
.setting-line .radio-line input:checked {
17+
box-shadow: inset 0 0 0 3px #0f1419;
18+
background-color: #ffb454;
19+
}
20+
.setting-line .radio-line input:focus {
21+
box-shadow: 0 0 1px 1px #ffb454;
22+
}
23+
/* In here we combine both `:focus` and `:checked` properties. */
24+
.setting-line .radio-line input:checked:focus {
25+
box-shadow: inset 0 0 0 3px 0f1419,
26+
0 0 2px 2px #ffb454;
27+
}
28+
.setting-line .radio-line input:hover {
29+
border-color: #ffb454 !important;
30+
}
31+
1332
h1, h2, h3, h4 {
1433
color: white;
1534
}

src/librustdoc/html/static/css/themes/dark.css

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ body, #settings-menu #settings, #settings-menu #settings::before {
33
color: #ddd;
44
}
55

6+
.setting-line .radio-line input {
7+
border-color: #ddd;
8+
}
9+
.setting-line .radio-line input:checked {
10+
box-shadow: inset 0 0 0 3px #353535;
11+
background-color: #2196f3;
12+
}
13+
.setting-line .radio-line input:focus {
14+
box-shadow: 0 0 1px 1px #2196f3;
15+
}
16+
/* In here we combine both `:focus` and `:checked` properties. */
17+
.setting-line .radio-line input:checked:focus {
18+
box-shadow: inset 0 0 0 3px #353535,
19+
0 0 2px 2px #2196f3;
20+
}
21+
.setting-line .radio-line input:hover {
22+
border-color: #2196f3 !important;
23+
}
24+
625
h1, h2, h3, h4 {
726
color: #ddd;
827
}
@@ -472,9 +491,6 @@ div.files > a:hover, div.name:hover {
472491
div.files > .selected {
473492
background-color: #333;
474493
}
475-
.setting-line > .title {
476-
border-bottom-color: #ddd;
477-
}
478494

479495
.scraped-example-list .scrape-help {
480496
border-color: #aaa;

src/librustdoc/html/static/css/themes/light.css

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ body, #settings-menu #settings, #settings-menu #settings::before {
55
color: black;
66
}
77

8+
.setting-line .radio-line input {
9+
border-color: black;
10+
}
11+
.setting-line .radio-line input:checked {
12+
box-shadow: inset 0 0 0 3px white;
13+
background-color: #2196f3;
14+
}
15+
.setting-line .radio-line input:focus {
16+
box-shadow: 0 0 1px 1px #2196f3;
17+
}
18+
/* In here we combine both `:focus` and `:checked` properties. */
19+
.setting-line .radio-line input:checked:focus {
20+
box-shadow: inset 0 0 0 3px white,
21+
0 0 2px 2px #2196f3;
22+
}
23+
.setting-line .radio-line input:hover {
24+
border-color: #2196f3 !important;
25+
}
26+
827
h1, h2, h3, h4 {
928
color: black;
1029
}
@@ -456,9 +475,6 @@ div.files > a:hover, div.name:hover {
456475
div.files > .selected {
457476
background-color: #fff;
458477
}
459-
.setting-line > .title {
460-
border-bottom-color: #D5D5D5;
461-
}
462478

463479
.scraped-example-list .scrape-help {
464480
border-color: #555;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
output += `<label for="${js_data_name}-${option}" class="choice">\
124124
<input type="radio" name="${js_data_name}" \
125125
id="${js_data_name}-${option}" value="${option}"${checked}>\
126-
${option}\
126+
<span>${option}</span>\
127127
</label>`;
128128
});
129129
output += "</div></div>";

0 commit comments

Comments
 (0)