Skip to content

Commit

Permalink
Rollup merge of #104250 - GuillaumeGomez:migrate-not-found-link-color…
Browse files Browse the repository at this point in the history
…, r=notriddle

Migrate no result page link color to CSS variables

r? ``@notriddle``
  • Loading branch information
GuillaumeGomez authored Nov 12, 2022
2 parents 55ae651 + ee73812 commit 6601e20
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
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)",
})

0 comments on commit 6601e20

Please sign in to comment.