Skip to content

Commit f35dccb

Browse files
authored
Rollup merge of #103938 - notriddle:notriddle/search-results-border-bottom, r=GuillaumeGomez
rustdoc: clean up hardcoded CSS border color on search results Hardcoded colors in rustdoc.css should usually be avoided. Preview: http://notriddle.com/notriddle-rustdoc-demos/border-bottom-search/test_dingus/?search=test
2 parents 9ef3b41 + f097940 commit f35dccb

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ so that we can apply CSS-filters to change the arrow color in themes */
894894
/* A little margin ensures the browser's outlining of focused links has room to display. */
895895
margin-left: 2px;
896896
margin-right: 2px;
897-
border-bottom: 1px solid #aaa3;
897+
border-bottom: 1px solid var(--border-color);
898898
}
899899

900900
.search-results > a > div {
@@ -1874,7 +1874,6 @@ in storage.js
18741874

18751875
/* Display an alternating layout on tablets and phones */
18761876
.search-results > a {
1877-
border-bottom: 1px solid #aaa9;
18781877
padding: 5px 0px;
18791878
}
18801879
.search-results .result-name, .search-results div.desc {

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

+18
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ assert-css: (
7575
{"color": "rgb(0, 150, 207)"},
7676
)
7777

78+
// Checking the color of the bottom border.
79+
assert-css: (
80+
".search-results > a",
81+
{"border-bottom-color": "rgb(92, 103, 115)"}
82+
)
83+
7884
// Checking the color of "keyword" text.
7985
assert-css: (
8086
"//*[@class='result-name']//*[text()='(keyword)']",
@@ -181,6 +187,12 @@ assert-css: (
181187
{"color": "rgb(221, 221, 221)"},
182188
)
183189

190+
// Checking the color of the bottom border.
191+
assert-css: (
192+
".search-results > a",
193+
{"border-bottom-color": "rgb(224, 224, 224)"}
194+
)
195+
184196
// Checking the color for "keyword" text.
185197
assert-css: (
186198
"//*[@class='result-name']//*[text()='(keyword)']",
@@ -272,6 +284,12 @@ assert-css: (
272284
{"color": "rgb(0, 0, 0)"},
273285
)
274286

287+
// Checking the color of the bottom border.
288+
assert-css: (
289+
".search-results > a",
290+
{"border-bottom-color": "rgb(224, 224, 224)"}
291+
)
292+
275293
// Checking the color for "keyword" text.
276294
assert-css: (
277295
"//*[@class='result-name']//*[text()='(keyword)']",

0 commit comments

Comments
 (0)