Rollup merge of #104250 - GuillaumeGomez:migrate-not-found-link-color, r=notriddle

Migrate no result page link color to CSS variables

r? ``@notriddle``
This commit is contained in:
Guillaume Gomez 2022-11-12 17:25:02 +01:00 committed by GitHub
commit 6601e20148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 13 deletions

View File

@ -160,10 +160,6 @@ details.rustdoc-toggle > summary::before {
color: #788797;
}
.search-failed a {
color: #39AFD7;
}
.tooltip::after {
background-color: #314559;
color: #c5c5c5;

View File

@ -82,10 +82,6 @@ details.rustdoc-toggle > summary::before {
filter: invert(100%);
}
.search-failed a {
color: #0089ff;
}
.tooltip::after {
background-color: #000;
color: #fff;

View File

@ -69,17 +69,12 @@
--crate-search-hover-border: #717171;
}
.content .item-info::before { color: #ccc; }
body.source .example-wrap pre.rust a {
background: #eee;
}
.search-failed a {
color: #3873AD;
}
.tooltip::after {
background-color: #000;
color: #fff;

View File

@ -0,0 +1,36 @@
// The goal of this test is to check the color of the "no result" links.
goto: "file://" + |DOC_PATH| + "/lib2/index.html?search=sdkfskjfsdks"
show-text: true
define-function: (
"check-no-result",
(theme, link, link_hover),
[
// Changing theme.
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
("reload"),
("wait-for", "#results"),
("assert", ".search-failed.active"),
("assert-css", ("#results a", {"color": |link|}, ALL)),
("move-cursor-to", "#results a"),
("assert-css", ("#results a:hover", {"color": |link_hover|})),
// Moving the cursor to some other place to not create issues with next function run.
("move-cursor-to", ".search-input"),
]
)
call-function: ("check-no-result", {
"theme": "ayu",
"link": "rgb(57, 175, 215)",
"link_hover": "rgb(57, 175, 215)",
})
call-function: ("check-no-result", {
"theme": "dark",
"link": "rgb(210, 153, 29)",
"link_hover": "rgb(210, 153, 29)",
})
call-function: ("check-no-result", {
"theme": "light",
"link": "rgb(56, 115, 173)",
"link_hover": "rgb(56, 115, 173)",
})