Hide search bar in noscript.css

Also, remove the highlighting of the search bar in disabled state. This
reduces flicker when loading a page.
This commit is contained in:
Jacob Hoffman-Andrews 2021-10-26 18:50:07 -07:00
parent c7e4740ec1
commit a4fe76ff7c
7 changed files with 18 additions and 14 deletions

View File

@ -13,3 +13,12 @@ rules.
/* It requires JS to work so no need to display it in this case. */
display: none;
}
.sub {
/* The search bar and related controls don't work without JS */
display: none;
}
#theme-picker {
display: none;
}

View File

@ -255,10 +255,6 @@ details.undocumented > summary::before {
box-shadow: 0 0 0 1px #148099,0 0 0 2px transparent;
}
.search-input:disabled {
background-color: #3e3e3e;
}
.module-item .stab,
.import-item .stab {
color: #000;

View File

@ -219,10 +219,6 @@ details.undocumented > summary::before {
border-color: #008dfd;
}
.search-input:disabled {
background-color: #c5c4c4;
}
#crate-search + .search-input:focus {
box-shadow: 0 0 8px 4px #078dd8;
}

View File

@ -209,10 +209,6 @@ details.undocumented > summary::before {
border-color: #66afe9;
}
.search-input:disabled {
background-color: #e6e6e6;
}
#crate-search + .search-input:focus {
box-shadow: 0 0 8px #078dd8;
}

View File

@ -263,7 +263,9 @@ function hideThemeButtonState() {
search_input.placeholder = searchState.input.origPlaceholder;
});
search_input.removeAttribute('disabled');
if (search_input.value != '') {
loadSearch();
}
// `crates{version}.js` should always be loaded before this script, so we can use it
// safely.

View File

@ -85,7 +85,6 @@
<input {# -#}
class="search-input" {# -#}
name="search" {# -#}
disabled {# -#}
autocomplete="off" {# -#}
spellcheck="false" {# -#}
placeholder="Click or press S to search, ? for more options…" {# -#}

View File

@ -0,0 +1,6 @@
// When JavaScript is disabled, we hide the search bar, because it
// can't be used without JS.
javascript: false
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
assert-css: (".sub", {"display": "none"})