Skip to content

Commit 786e0b5

Browse files
authored
Rollup merge of #106153 - GuillaumeGomez:search-tabs-headers, r=notriddle
Fix missing renaming for #titles into #search-tabs We forgot to update this selector in the themes in #106069. r? `@notriddle`
2 parents 2426582 + caa201f commit 786e0b5

File tree

4 files changed

+84
-8
lines changed

4 files changed

+84
-8
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,18 @@ pre, .rustdoc.source .example-wrap {
162162
color: #788797;
163163
}
164164

165-
#titles > button.selected {
165+
#search-tabs > button.selected {
166166
background-color: #141920 !important;
167167
border-bottom: 1px solid #ffb44c !important;
168168
border-top: none;
169169
}
170170

171-
#titles > button:not(.selected) {
171+
#search-tabs > button:not(.selected) {
172172
background-color: transparent !important;
173173
border: none;
174174
}
175175

176-
#titles > button:hover {
176+
#search-tabs > button:hover {
177177
border-bottom: 1px solid rgba(242, 151, 24, 0.3);
178178
}
179179

@@ -185,7 +185,7 @@ above the `@media (max-width: 700px)` rules due to a bug in the css checker */
185185
/* see https://github.com/rust-lang/rust/pull/71237#issuecomment-618170143 */
186186
pre.rust .lifetime {}
187187
pre.rust .kw {}
188-
#titles > button:hover, #titles > button.selected {}
188+
#search-tabs > button:hover, #search-tabs > button.selected {}
189189
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, pre.rust .attribute {}
190190
pre.rust .kw-2, pre.rust .prelude-ty {}
191191

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@
8888
--scrape-example-toggle-line-hover-background: #c5c5c5;
8989
}
9090

91-
#titles > button:not(.selected) {
91+
#search-tabs > button:not(.selected) {
9292
background-color: #252525;
9393
border-top-color: #252525;
9494
}
9595

96-
#titles > button:hover, #titles > button.selected {
96+
#search-tabs > button:hover, #search-tabs > button.selected {
9797
border-top-color: #0089ff;
9898
background-color: #353535;
9999
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585
--scrape-example-toggle-line-hover-background: #999;
8686
}
8787

88-
#titles > button:not(.selected) {
88+
#search-tabs > button:not(.selected) {
8989
background-color: #e6e6e6;
9090
border-top-color: #e6e6e6;
9191
}
9292

93-
#titles > button:hover, #titles > button.selected {
93+
#search-tabs > button:hover, #search-tabs > button.selected {
9494
background-color: #ffffff;
9595
border-top-color: #0089ff;
9696
}

src/test/rustdoc-gui/search-tab.goml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Checking the colors of the search tab headers.
2+
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html?search=something"
3+
show-text: true
4+
5+
define-function: (
6+
"check-colors",
7+
(theme, background, background_selected, background_hover, border_bottom,
8+
border_bottom_selected, border_bottom_hover, border_top, border_top_selected,
9+
border_top_hover),
10+
[
11+
// Setting the theme.
12+
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
13+
("reload"),
14+
15+
// These two commands are used to be sure the search will be run.
16+
("focus", ".search-input"),
17+
("press-key", "Enter"),
18+
19+
("wait-for", "#search-tabs"),
20+
("assert-css", ("#search-tabs > button:not(.selected)", {
21+
"background-color": |background|,
22+
"border-bottom": |border_bottom|,
23+
"border-top": |border_top|,
24+
})),
25+
("assert-css", ("#search-tabs > button.selected", {
26+
"background-color": |background_selected|,
27+
"border-bottom": |border_bottom_selected|,
28+
"border-top": |border_top_selected|,
29+
})),
30+
("move-cursor-to", "#search-tabs > button:not(.selected)"),
31+
("assert-css", ("#search-tabs > button:not(.selected):hover", {
32+
"background-color": |background_hover|,
33+
"border-bottom": |border_bottom_hover|,
34+
"border-top": |border_top_hover|,
35+
})),
36+
// To prevent disrupting next run of this function.
37+
("move-cursor-to", ".search-input"),
38+
],
39+
)
40+
41+
call-function: ("check-colors", {
42+
"theme": "ayu",
43+
"background": "rgba(0, 0, 0, 0)",
44+
"background_selected": "rgb(20, 25, 32)",
45+
"background_hover": "rgba(0, 0, 0, 0)",
46+
"border_bottom": "0px none rgb(197, 197, 197)",
47+
"border_bottom_selected": "1px solid rgb(255, 180, 76)",
48+
"border_bottom_hover": "1px solid rgba(242, 151, 24, 0.3)",
49+
"border_top": "0px none rgb(197, 197, 197)",
50+
"border_top_selected": "0px none rgb(197, 197, 197)",
51+
"border_top_hover": "0px none rgb(197, 197, 197)",
52+
})
53+
call-function: ("check-colors", {
54+
"theme": "dark",
55+
"background": "rgb(37, 37, 37)",
56+
"background_selected": "rgb(53, 53, 53)",
57+
"background_hover": "rgb(53, 53, 53)",
58+
"border_bottom": "0px none rgb(221, 221, 221)",
59+
"border_bottom_selected": "0px none rgb(221, 221, 221)",
60+
"border_bottom_hover": "0px none rgb(221, 221, 221)",
61+
"border_top": "2px solid rgb(37, 37, 37)",
62+
"border_top_selected": "2px solid rgb(0, 137, 255)",
63+
"border_top_hover": "2px solid rgb(0, 137, 255)",
64+
})
65+
call-function: ("check-colors", {
66+
"theme": "light",
67+
"background": "rgb(230, 230, 230)",
68+
"background_selected": "rgb(255, 255, 255)",
69+
"background_hover": "rgb(255, 255, 255)",
70+
"border_bottom": "0px none rgb(0, 0, 0)",
71+
"border_bottom_selected": "0px none rgb(0, 0, 0)",
72+
"border_bottom_hover": "0px none rgb(0, 0, 0)",
73+
"border_top": "2px solid rgb(230, 230, 230)",
74+
"border_top_selected": "2px solid rgb(0, 137, 255)",
75+
"border_top_hover": "2px solid rgb(0, 137, 255)",
76+
})

0 commit comments

Comments
 (0)