Rollup merge of #97113 - GuillaumeGomez:search-ui-fixes, r=notriddle
Search GUI fixes The first fix is about the duplicated "in":  The second fix is about the `<select>` broken style:   You can test it [here](https://rustdoc.crud.net/imperio/search-ui-fixes/doc/foo/index.html?search=test). r? `@notriddle`
This commit is contained in:
commit
b8dd27079c
7 changed files with 43 additions and 9 deletions
|
@ -1 +1 @@
|
||||||
0.9.1
|
0.9.2
|
|
@ -897,7 +897,7 @@ table,
|
||||||
margin-left: 0.25em;
|
margin-left: 0.25em;
|
||||||
padding-left: 0.3125em;
|
padding-left: 0.3125em;
|
||||||
padding-right: 23px;
|
padding-right: 23px;
|
||||||
border: 0;
|
border: 1px solid;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
outline: none;
|
outline: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -2010,7 +2010,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
|
||||||
|
|
||||||
#crate-search {
|
#crate-search {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.docblock {
|
.docblock {
|
||||||
|
|
|
@ -236,8 +236,8 @@ details.undocumented > summary::before {
|
||||||
|
|
||||||
#crate-search, .search-input {
|
#crate-search, .search-input {
|
||||||
background-color: #141920;
|
background-color: #141920;
|
||||||
border-color: #424c57;
|
/* Without the `!important`, the border-color is ignored for `<select>`... */
|
||||||
color: #c5c5c5;
|
border-color: #424c57 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
|
|
|
@ -217,7 +217,8 @@ details.undocumented > summary::before {
|
||||||
#crate-search, .search-input {
|
#crate-search, .search-input {
|
||||||
color: #111;
|
color: #111;
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
border-color: #000;
|
/* Without the `!important`, the border-color is ignored for `<select>`... */
|
||||||
|
border-color: #f0f0f0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
|
|
|
@ -209,9 +209,9 @@ details.undocumented > summary::before {
|
||||||
}
|
}
|
||||||
|
|
||||||
#crate-search, .search-input {
|
#crate-search, .search-input {
|
||||||
color: #555;
|
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-color: #e0e0e0;
|
/* Without the `!important`, the border-color is ignored for `<select>`... */
|
||||||
|
border-color: #e0e0e0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input:focus {
|
.search-input:focus {
|
||||||
|
|
|
@ -1738,7 +1738,7 @@ function initSearch(rawSearchIndex) {
|
||||||
|
|
||||||
let output = "<div id=\"search-settings\">" +
|
let output = "<div id=\"search-settings\">" +
|
||||||
`<h1 class="search-results-title">Results for ${escape(results.query.userQuery)}` +
|
`<h1 class="search-results-title">Results for ${escape(results.query.userQuery)}` +
|
||||||
`${typeFilter}</h1> in ${crates} </div>`;
|
`${typeFilter}</h1>${crates}</div>`;
|
||||||
if (results.query.error !== null) {
|
if (results.query.error !== null) {
|
||||||
output += `<h3>Query parser error: "${results.query.error}".</h3>`;
|
output += `<h3>Query parser error: "${results.query.error}".</h3>`;
|
||||||
output += "<div id=\"titles\">" +
|
output += "<div id=\"titles\">" +
|
||||||
|
|
|
@ -45,3 +45,37 @@ goto: file://|DOC_PATH|/test_docs/index.html?search=test&filter-crate=lib2
|
||||||
wait-for: "#crate-search"
|
wait-for: "#crate-search"
|
||||||
assert-property: ("#crate-search", {"value": "lib2"})
|
assert-property: ("#crate-search", {"value": "lib2"})
|
||||||
assert-false: "#results .externcrate"
|
assert-false: "#results .externcrate"
|
||||||
|
|
||||||
|
// Checking that the text for the "title" is correct (the "All" comes from the "<select>").
|
||||||
|
assert-text: ("#search-settings", "Results for test in All", STARTS_WITH)
|
||||||
|
|
||||||
|
// Checking the display of the crate filter.
|
||||||
|
// We start with the light theme.
|
||||||
|
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
|
||||||
|
reload:
|
||||||
|
|
||||||
|
timeout: 2000
|
||||||
|
wait-for: "#crate-search"
|
||||||
|
assert-css: ("#crate-search", {
|
||||||
|
"border": "1px solid rgb(224, 224, 224)",
|
||||||
|
"color": "rgb(0, 0, 0)",
|
||||||
|
"background-color": "rgb(255, 255, 255)",
|
||||||
|
})
|
||||||
|
|
||||||
|
// We now check the dark theme.
|
||||||
|
click: "#settings-menu"
|
||||||
|
wait-for: "#settings"
|
||||||
|
click: "#theme-dark"
|
||||||
|
wait-for-css: ("#crate-search", {
|
||||||
|
"border": "1px solid rgb(240, 240, 240)",
|
||||||
|
"color": "rgb(17, 17, 17)",
|
||||||
|
"background-color": "rgb(240, 240, 240)",
|
||||||
|
})
|
||||||
|
|
||||||
|
// And finally we check the ayu theme.
|
||||||
|
click: "#theme-ayu"
|
||||||
|
wait-for-css: ("#crate-search", {
|
||||||
|
"border": "1px solid rgb(66, 76, 87)",
|
||||||
|
"color": "rgb(197, 197, 197)",
|
||||||
|
"background-color": "rgb(20, 25, 32)",
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue