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

rustdoc UI fixes #99489

Merged
merged 4 commits into from
Jul 20, 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
5 changes: 1 addition & 4 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ table,
#crate-search {
min-width: 115px;
margin-top: 5px;
padding-left: 0.3125em;
padding-left: 0.15em;
padding-right: 23px;
border: 1px solid;
border-radius: 4px;
Expand All @@ -958,8 +958,6 @@ table,
-moz-appearance: none;
-webkit-appearance: none;
/* Removes default arrow from firefox */
text-indent: 0.01px;
text-overflow: "";
background-repeat: no-repeat;
background-color: transparent;
background-size: 20px;
Expand All @@ -986,7 +984,6 @@ table,
border-radius: 2px;
padding: 8px;
font-size: 1rem;
transition: border-color 300ms ease;
width: 100%;
}

Expand Down
8 changes: 7 additions & 1 deletion src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ details.rustdoc-toggle > summary::before {

#crate-search, .search-input {
background-color: #141920;
/* Without the `!important`, the border-color is ignored for `<select>`... */
border-color: #424c57;
}

#crate-search {
/* Without the `!important`, the border-color is ignored for `<select>`...
It cannot be in the group above because `.search-input` has a different border color on
hover. */
border-color: #424c57 !important;
}

Expand Down
8 changes: 7 additions & 1 deletion src/librustdoc/html/static/css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ details.rustdoc-toggle > summary::before {
#crate-search, .search-input {
color: #111;
background-color: #f0f0f0;
/* Without the `!important`, the border-color is ignored for `<select>`... */
border-color: #f0f0f0;
}

#crate-search {
/* Without the `!important`, the border-color is ignored for `<select>`...
It cannot be in the group above because `.search-input` has a different border color on
hover. */
border-color: #f0f0f0 !important;
}

Expand Down
8 changes: 7 additions & 1 deletion src/librustdoc/html/static/css/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ details.rustdoc-toggle > summary::before {

#crate-search, .search-input {
background-color: white;
/* Without the `!important`, the border-color is ignored for `<select>`... */
border-color: #e0e0e0;
}

#crate-search {
/* Without the `!important`, the border-color is ignored for `<select>`...
It cannot be in the group above because `.search-input` has a different border color on
hover. */
border-color: #e0e0e0 !important;
}

Expand Down
23 changes: 23 additions & 0 deletions src/test/rustdoc-gui/search-input.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Ensures that the search input border color changes on focus.
goto: file://|DOC_PATH|/test_docs/index.html
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:

assert-css: (".search-input", {"border-color": "rgb(224, 224, 224)"})
click: ".search-input"
focus: ".search-input"
assert-css: (".search-input", {"border-color": "rgb(0, 141, 253)"})

local-storage: {"rustdoc-theme": "light"}
reload:

assert-css: (".search-input", {"border-color": "rgb(224, 224, 224)"})
click: ".search-input"
assert-css: (".search-input", {"border-color": "rgb(102, 175, 233)"})

local-storage: {"rustdoc-theme": "ayu"}
reload:

assert-css: (".search-input", {"border-color": "rgb(66, 76, 87)"})
click: ".search-input"
assert-css: (".search-input", {"border-color": "rgb(66, 76, 87)"})
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/search-result-display.goml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ assert-css: (".search-results div.desc", {"width": "570px"})
size: (900, 900)

// First we check the current width and position.
assert-css: ("#crate-search", {"width": "222px"})
assert-css: ("#crate-search", {"width": "218px"})
compare-elements-position-near: (
"#crate-search",
"#search-settings .search-results-title",
Expand Down