Skip to content

Commit 1a7bcfb

Browse files
committed
rustdoc: fix colors for top buttons and search
Make sure the top buttons and search have the same border color and the same color for the icon inside.
1 parent fc32303 commit 1a7bcfb

File tree

5 files changed

+55
-37
lines changed

5 files changed

+55
-37
lines changed

src/librustdoc/html/static/css/rustdoc.css

-1
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,6 @@ table,
902902
margin-left: 0.25em;
903903
padding-left: 0.3125em;
904904
padding-right: 23px;
905-
border: 0;
906905
border-radius: 4px;
907906
outline: none;
908907
cursor: pointer;

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

+12-9
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,19 @@ details.undocumented > summary::before {
234234
filter: invert(100%);
235235
}
236236

237-
#crate-search, .search-input {
237+
#theme-picker, #settings-menu, #help-button,
238+
#crate-search, .search-input, .search-input::placeholder {
238239
background-color: #141920;
239240
border-color: #424c57;
240-
color: #c5c5c5;
241+
color: grey;
242+
}
243+
244+
#crate-search {
245+
color: white;
241246
}
242247

243248
.search-input {
244-
color: #ffffff;
249+
color: white;
245250
}
246251

247252
.module-item .stab,
@@ -531,16 +536,14 @@ kbd {
531536
box-shadow: inset 0 -1px 0 #5c6773;
532537
}
533538

534-
#theme-picker, #settings-menu, #help-button {
535-
border-color: #5c6773;
536-
background-color: #0f1419;
537-
color: #fff;
538-
}
539-
540539
#theme-picker > img, #settings-menu > img {
541540
filter: invert(100);
542541
}
543542

543+
.sub-container img {
544+
opacity: 50%;
545+
}
546+
544547
#copy-path {
545548
color: #fff;
546549
}

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

+14-11
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,23 @@ details.undocumented > summary::before {
214214
filter: invert(100%);
215215
}
216216

217-
#crate-search, .search-input {
218-
color: #111;
219-
background-color: #f0f0f0;
220-
border-color: #000;
217+
#theme-picker, #settings-menu, #help-button,
218+
#crate-search, .search-input, .search-input::placeholder {
219+
color: grey;
220+
background-color: #353535;
221+
border-color: #505050;
222+
}
223+
224+
#theme-picker > img, #settings-menu > img {
225+
filter: invert(50%);
226+
}
227+
228+
#crate-search {
229+
color: white;
221230
}
222231

223232
.search-input {
224-
border-color: #e0e0e0;
233+
color: white;
225234
}
226235

227236
.search-input:focus {
@@ -408,12 +417,6 @@ kbd {
408417
box-shadow: inset 0 -1px 0 #c6cbd1;
409418
}
410419

411-
#theme-picker, #settings-menu, #help-button {
412-
border-color: #e0e0e0;
413-
background: #f0f0f0;
414-
color: #000;
415-
}
416-
417420
#theme-picker:hover, #theme-picker:focus,
418421
#settings-menu:hover, #settings-menu:focus,
419422
#help-button:hover, #help-button:focus {

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

+17-13
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,27 @@ details.undocumented > summary::before {
208208
color: #999;
209209
}
210210

211-
#crate-search, .search-input {
212-
color: #555;
211+
#theme-picker:hover, #theme-picker:focus,
212+
#settings-menu:hover, #settings-menu:focus,
213+
#help-button:hover, #help-button:focus {
214+
border-color: #717171;
215+
}
216+
217+
#theme-picker, #settings-menu, #help-button,
218+
#crate-search, .search-input, .search-input::placeholder {
219+
color: grey;
213220
background-color: white;
214221
border-color: #e0e0e0;
215222
}
216223

224+
#crate-search {
225+
color: black;
226+
}
227+
228+
.sub-container img {
229+
opacity: 50%;
230+
}
231+
217232
.search-input:focus {
218233
border-color: #66afe9;
219234
}
@@ -394,17 +409,6 @@ kbd {
394409
box-shadow: inset 0 -1px 0 #c6cbd1;
395410
}
396411

397-
#theme-picker, #settings-menu, #help-button {
398-
border-color: #e0e0e0;
399-
background-color: #fff;
400-
}
401-
402-
#theme-picker:hover, #theme-picker:focus,
403-
#settings-menu:hover, #settings-menu:focus,
404-
#help-button:hover, #help-button:focus {
405-
border-color: #717171;
406-
}
407-
408412
#copy-path {
409413
color: #999;
410414
}

src/test/rustdoc-gui/headers-color.goml

+12-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ assert-css: (
1919
)
2020
assert-css: (
2121
".impl .code-header",
22-
{"color": "rgb(230, 225, 207)", "background-color": "rgb(15, 20, 25)"},
22+
{"color": "rgb(230, 225, 207)", "background-color": "rgba(0, 0, 0, 0)"},
2323
ALL,
2424
)
2525

26+
compare-elements-css: ("#settings-menu", "#help-button", ["border-color", "background-color", "color"])
27+
compare-elements-css: ("#settings-menu", ".search-input", ["border-color", "color"])
28+
2629
goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl
2730
assert-css: (
2831
"#impl",
@@ -58,7 +61,7 @@ assert-css: (
5861
)
5962
assert-css: (
6063
".impl .code-header",
61-
{"color": "rgb(221, 221, 221)", "background-color": "rgb(53, 53, 53)"},
64+
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
6265
ALL,
6366
)
6467

@@ -75,6 +78,9 @@ assert-css: (
7578
ALL,
7679
)
7780

81+
compare-elements-css: ("#settings-menu", "#help-button", ["border-color", "background-color", "color"])
82+
compare-elements-css: ("#settings-menu", ".search-input", ["border-color", "color"])
83+
7884
goto: file://|DOC_PATH|/test_docs/index.html
7985
assert-css: (".small-section-header a", {"color": "rgb(221, 221, 221)"}, ALL)
8086

@@ -95,10 +101,13 @@ assert-css: (
95101
)
96102
assert-css: (
97103
".impl .code-header",
98-
{"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
104+
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
99105
ALL,
100106
)
101107

108+
compare-elements-css: ("#settings-menu", "#help-button", ["border-color", "background-color", "color"])
109+
compare-elements-css: ("#settings-menu", ".search-input", ["border-color", "color"])
110+
102111
goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl
103112
assert-css: ("#impl", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"})
104113

0 commit comments

Comments
 (0)