Skip to content

Commit

Permalink
Rollup merge of rust-lang#106035 - GuillaumeGomez:migrate-css-var-sea…
Browse files Browse the repository at this point in the history
…rch-tab-title-color, r=notriddle

Migrate search tab title color to CSS variable

r? `@notriddle`
  • Loading branch information
matthiaskrgr authored Dec 22, 2022
2 parents 72b8b69 + faebd7a commit 49ba6ae
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,7 @@ a.test-arrow:hover {
#titles > button > div.count {
display: inline-block;
font-size: 1rem;
color: var(--search-tab-title-count-color);
}

#src-sidebar-toggle {
Expand Down
5 changes: 1 addition & 4 deletions src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
--search-color: #fff;
--search-results-alias-color: #c5c5c5;
--search-results-grey-color: #999;
--search-tab-title-count-color: #888;
--stab-background-color: #314559;
--stab-code-color: #e6e1cf;
--code-highlight-kw-color: #ff7733;
Expand Down Expand Up @@ -175,10 +176,6 @@ pre, .rustdoc.source .example-wrap {
border-bottom: 1px solid rgba(242, 151, 24, 0.3);
}

#titles > button > div.count {
color: #888;
}

/* rules that this theme does not need to set, here to satisfy the rule checker */
/* note that a lot of these are partially set in some way (meaning they are set
individually rather than as a group) */
Expand Down
5 changes: 1 addition & 4 deletions src/librustdoc/html/static/css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
--search-color: #111;
--search-results-alias-color: #fff;
--search-results-grey-color: #ccc;
--search-tab-title-count-color: #888;
--stab-background-color: #314559;
--stab-code-color: #e6e1cf;
--code-highlight-kw-color: #ab8ac1;
Expand Down Expand Up @@ -96,10 +97,6 @@
background-color: #353535;
}

#titles > button > div.count {
color: #888;
}

.scraped-example-list .scrape-help {
border-color: #aaa;
color: #eee;
Expand Down
5 changes: 1 addition & 4 deletions src/librustdoc/html/static/css/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
--search-color: #000;
--search-results-alias-color: #000;
--search-results-grey-color: #999;
--search-tab-title-count-color: #888;
--stab-background-color: #fff5d6;
--stab-code-color: #000;
--code-highlight-kw-color: #8959a8;
Expand Down Expand Up @@ -93,10 +94,6 @@
border-top-color: #0089ff;
}

#titles > button > div.count {
color: #888;
}

.scraped-example-list .scrape-help {
border-color: #555;
color: #333;
Expand Down
15 changes: 15 additions & 0 deletions src/test/rustdoc-gui/search-result-color.goml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ reload:

// Waiting for the search results to appear...
wait-for: "#titles"
assert-css: (
"#titles > button > div.count",
{"color": "rgb(136, 136, 136)"},
ALL,
)
assert-css: (
"//*[@class='desc'][text()='Just a normal struct.']",
{"color": "rgb(197, 197, 197)"},
Expand Down Expand Up @@ -178,6 +183,11 @@ reload:

// Waiting for the search results to appear...
wait-for: "#titles"
assert-css: (
"#titles > button > div.count",
{"color": "rgb(136, 136, 136)"},
ALL,
)
assert-css: (
"//*[@class='desc'][text()='Just a normal struct.']",
{"color": "rgb(221, 221, 221)"},
Expand Down Expand Up @@ -275,6 +285,11 @@ reload:

// Waiting for the search results to appear...
wait-for: "#titles"
assert-css: (
"#titles > button > div.count",
{"color": "rgb(136, 136, 136)"},
ALL,
)
assert-css: (
"//*[@class='desc'][text()='Just a normal struct.']",
{"color": "rgb(0, 0, 0)"},
Expand Down

0 comments on commit 49ba6ae

Please sign in to comment.