Skip to content

Commit fbcaf04

Browse files
authored
Rollup merge of #107477 - GuillaumeGomez:css-var, r=notriddle
Migrate last part of CSS themes to CSS variables No changes in the output. This is already tested in `tests/rustdoc-gui/search-tab.goml` so no need to add a GUI test. r? `@notriddle`
2 parents b10e601 + e9f5630 commit fbcaf04

File tree

4 files changed

+21
-32
lines changed

4 files changed

+21
-32
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,14 @@ a.test-arrow:hover {
12621262
line-height: 1.5;
12631263
color: inherit;
12641264
}
1265+
#search-tabs button:not(.selected) {
1266+
background-color: var(--search-tab-button-not-selected-background);
1267+
border-top-color: var(--search-tab-button-not-selected-border-top-color);
1268+
}
1269+
#search-tabs button:hover, #search-tabs button.selected {
1270+
background-color: var(--search-tab-button-selected-background);
1271+
border-top-color: var(--search-tab-button-selected-border-top-color);
1272+
}
12651273

12661274
#search-tabs .count {
12671275
font-size: 1rem;

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

+5-12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Original by Dempfi (https://github.com/dempfi/ayu)
4646
--search-results-alias-color: #c5c5c5;
4747
--search-results-grey-color: #999;
4848
--search-tab-title-count-color: #888;
49+
--search-tab-button-not-selected-border-top-color: none;
50+
--search-tab-button-not-selected-background: transparent !important;
51+
--search-tab-button-selected-border-top-color: none;
52+
--search-tab-button-selected-background: #141920 !important;
4953
--stab-background-color: #314559;
5054
--stab-code-color: #e6e1cf;
5155
--code-highlight-kw-color: #ff7733;
@@ -171,28 +175,17 @@ pre, .rustdoc.source .example-wrap {
171175
}
172176

173177
#search-tabs > button.selected {
174-
background-color: #141920 !important;
175178
border-bottom: 1px solid #ffb44c !important;
176179
border-top: none;
177180
}
178-
179181
#search-tabs > button:not(.selected) {
180-
background-color: transparent !important;
181182
border: none;
183+
background-color: transparent !important;
182184
}
183-
184185
#search-tabs > button:hover {
185186
border-bottom: 1px solid rgba(242, 151, 24, 0.3);
186187
}
187188

188-
/* rules that this theme does not need to set, here to satisfy the rule checker */
189-
/* note that a lot of these are partially set in some way (meaning they are set
190-
individually rather than as a group) */
191-
/* FIXME: these rules should be at the bottom of the file but currently must be
192-
above the `@media (max-width: 700px)` rules due to a bug in the css checker */
193-
/* see https://github.com/rust-lang/rust/pull/71237#issuecomment-618170143 */
194-
#search-tabs > button:hover, #search-tabs > button.selected {}
195-
196189
#settings-menu > a img {
197190
filter: invert(100);
198191
}

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

+4-10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
--search-results-alias-color: #fff;
4242
--search-results-grey-color: #ccc;
4343
--search-tab-title-count-color: #888;
44+
--search-tab-button-not-selected-border-top-color: #252525;
45+
--search-tab-button-not-selected-background: #252525;
46+
--search-tab-button-selected-border-top-color: #0089ff;
47+
--search-tab-button-selected-background: #353535;
4448
--stab-background-color: #314559;
4549
--stab-code-color: #e6e1cf;
4650
--code-highlight-kw-color: #ab8ac1;
@@ -95,13 +99,3 @@
9599
--scrape-example-code-wrapper-background-start: rgba(53, 53, 53, 1);
96100
--scrape-example-code-wrapper-background-end: rgba(53, 53, 53, 0);
97101
}
98-
99-
#search-tabs > button:not(.selected) {
100-
background-color: #252525;
101-
border-top-color: #252525;
102-
}
103-
104-
#search-tabs > button:hover, #search-tabs > button.selected {
105-
border-top-color: #0089ff;
106-
background-color: #353535;
107-
}

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

+4-10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
--search-results-alias-color: #000;
4242
--search-results-grey-color: #999;
4343
--search-tab-title-count-color: #888;
44+
--search-tab-button-not-selected-border-top-color: #e6e6e6;
45+
--search-tab-button-not-selected-background: #e6e6e6;
46+
--search-tab-button-selected-border-top-color: #0089ff;
47+
--search-tab-button-selected-background: #ffffff;
4448
--stab-background-color: #fff5d6;
4549
--stab-code-color: #000;
4650
--code-highlight-kw-color: #8959a8;
@@ -92,13 +96,3 @@
9296
--scrape-example-code-wrapper-background-start: rgba(255, 255, 255, 1);
9397
--scrape-example-code-wrapper-background-end: rgba(255, 255, 255, 0);
9498
}
95-
96-
#search-tabs > button:not(.selected) {
97-
background-color: #e6e6e6;
98-
border-top-color: #e6e6e6;
99-
}
100-
101-
#search-tabs > button:hover, #search-tabs > button.selected {
102-
background-color: #ffffff;
103-
border-top-color: #0089ff;
104-
}

0 commit comments

Comments
 (0)