Skip to content

Commit 84e9887

Browse files
authored
2 parents af898f7 + f7cce2f commit 84e9887

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ pre, .rustdoc.source .example-wrap {
8383
}
8484

8585
.search-results a:hover {
86-
background-color: #777;
86+
color: #fff !important;
87+
background-color: #3c3c3c;
8788
}
8889

8990
.search-results a:focus {
90-
color: #000 !important;
91-
background-color: #c6afb3;
91+
color: #fff !important;
92+
background-color: #3c3c3c;
9293
}
9394
.search-results a {
9495
color: #0096cf;

src/test/rustdoc-gui/search-result-color.goml

+51
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,23 @@ assert-css: (
2929
{"color": "rgb(120, 135, 151)"},
3030
)
3131

32+
// Checking the `<a>` container.
33+
assert-css: (
34+
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
35+
{"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
36+
)
37+
38+
// Checking color and background on hover.
39+
move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
40+
assert-css: (
41+
"//*[@class='result-name']/*[text()='test_docs::']",
42+
{"color": "rgb(255, 255, 255)"},
43+
)
44+
assert-css: (
45+
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
46+
{"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
47+
)
48+
3249
// Dark theme
3350
local-storage: {
3451
"rustdoc-theme": "dark",
@@ -54,6 +71,23 @@ assert-css: (
5471
{"color": "rgb(221, 221, 221)"},
5572
)
5673

74+
// Checking the `<a>` container.
75+
assert-css: (
76+
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
77+
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
78+
)
79+
80+
// Checking color and background on hover.
81+
move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
82+
assert-css: (
83+
"//*[@class='result-name']/*[text()='test_docs::']",
84+
{"color": "rgb(221, 221, 221)"},
85+
)
86+
assert-css: (
87+
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
88+
{"color": "rgb(221, 221, 221)", "background-color": "rgb(119, 119, 119)"},
89+
)
90+
5791
// Light theme
5892
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
5993
reload:
@@ -75,6 +109,23 @@ assert-css: (
75109
{"color": "rgb(0, 0, 0)"},
76110
)
77111

112+
// Checking the `<a>` container.
113+
assert-css: (
114+
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
115+
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
116+
)
117+
118+
// Checking color and background on hover.
119+
move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
120+
assert-css: (
121+
"//*[@class='result-name']/*[text()='test_docs::']",
122+
{"color": "rgb(0, 0, 0)"},
123+
)
124+
assert-css: (
125+
"//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
126+
{"color": "rgb(0, 0, 0)", "background-color": "rgb(221, 221, 221)"},
127+
)
128+
78129
// Check the alias more specifically in the dark theme.
79130
goto: file://|DOC_PATH|/test_docs/index.html
80131
// We set the theme so we're sure that the correct values will be used, whatever the computer

0 commit comments

Comments
 (0)