Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate no result page link color to CSS variables #104250

Merged
merged 3 commits into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ details.rustdoc-toggle > summary::before {
color: #788797;
}

.search-failed a {
color: #39AFD7;
}

.tooltip::after {
background-color: #314559;
color: #c5c5c5;
Expand Down
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ details.rustdoc-toggle > summary::before {
filter: invert(100%);
}

.search-failed a {
color: #0089ff;
}

.tooltip::after {
background-color: #000;
color: #fff;
Expand Down
5 changes: 0 additions & 5 deletions src/librustdoc/html/static/css/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
36 changes: 36 additions & 0 deletions src/test/rustdoc-gui/search-no-result.goml
Original file line number Diff line number Diff line change
@@ -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)",
})