Skip to content

Commit 73ef81d

Browse files
authored
Rollup merge of #99489 - GuillaumeGomez:gui-fixes, r=notriddle
rustdoc UI fixes The first commit fixes this bug: ![Screenshot from 2022-07-20 02-54-26](https://user-images.githubusercontent.com/3050060/179879053-fc34f27a-6248-4f5c-9fcb-80adbfc1598c.png) ![Screenshot from 2022-07-20 03-00-03](https://user-images.githubusercontent.com/3050060/179879056-1c0973a0-d535-44e7-a48e-bad692034467.png) The second one fixes the missing change of border color when the search input is focused. cc `@jsha` r? `@notriddle`
2 parents a0c6964 + f4be88e commit 73ef81d

File tree

6 files changed

+46
-8
lines changed

6 files changed

+46
-8
lines changed

src/librustdoc/html/static/css/rustdoc.css

+1-4
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ table,
949949
#crate-search {
950950
min-width: 115px;
951951
margin-top: 5px;
952-
padding-left: 0.3125em;
952+
padding-left: 0.15em;
953953
padding-right: 23px;
954954
border: 1px solid;
955955
border-radius: 4px;
@@ -958,8 +958,6 @@ table,
958958
-moz-appearance: none;
959959
-webkit-appearance: none;
960960
/* Removes default arrow from firefox */
961-
text-indent: 0.01px;
962-
text-overflow: "";
963961
background-repeat: no-repeat;
964962
background-color: transparent;
965963
background-size: 20px;
@@ -986,7 +984,6 @@ table,
986984
border-radius: 2px;
987985
padding: 8px;
988986
font-size: 1rem;
989-
transition: border-color 300ms ease;
990987
width: 100%;
991988
}
992989

src/librustdoc/html/static/css/themes/ayu.css

+7-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ details.rustdoc-toggle > summary::before {
184184

185185
#crate-search, .search-input {
186186
background-color: #141920;
187-
/* Without the `!important`, the border-color is ignored for `<select>`... */
187+
border-color: #424c57;
188+
}
189+
190+
#crate-search {
191+
/* Without the `!important`, the border-color is ignored for `<select>`...
192+
It cannot be in the group above because `.search-input` has a different border color on
193+
hover. */
188194
border-color: #424c57 !important;
189195
}
190196

src/librustdoc/html/static/css/themes/dark.css

+7-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,13 @@ details.rustdoc-toggle > summary::before {
159159
#crate-search, .search-input {
160160
color: #111;
161161
background-color: #f0f0f0;
162-
/* Without the `!important`, the border-color is ignored for `<select>`... */
162+
border-color: #f0f0f0;
163+
}
164+
165+
#crate-search {
166+
/* Without the `!important`, the border-color is ignored for `<select>`...
167+
It cannot be in the group above because `.search-input` has a different border color on
168+
hover. */
163169
border-color: #f0f0f0 !important;
164170
}
165171

src/librustdoc/html/static/css/themes/light.css

+7-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ details.rustdoc-toggle > summary::before {
146146

147147
#crate-search, .search-input {
148148
background-color: white;
149-
/* Without the `!important`, the border-color is ignored for `<select>`... */
149+
border-color: #e0e0e0;
150+
}
151+
152+
#crate-search {
153+
/* Without the `!important`, the border-color is ignored for `<select>`...
154+
It cannot be in the group above because `.search-input` has a different border color on
155+
hover. */
150156
border-color: #e0e0e0 !important;
151157
}
152158

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Ensures that the search input border color changes on focus.
2+
goto: file://|DOC_PATH|/test_docs/index.html
3+
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
4+
reload:
5+
6+
assert-css: (".search-input", {"border-color": "rgb(224, 224, 224)"})
7+
click: ".search-input"
8+
focus: ".search-input"
9+
assert-css: (".search-input", {"border-color": "rgb(0, 141, 253)"})
10+
11+
local-storage: {"rustdoc-theme": "light"}
12+
reload:
13+
14+
assert-css: (".search-input", {"border-color": "rgb(224, 224, 224)"})
15+
click: ".search-input"
16+
assert-css: (".search-input", {"border-color": "rgb(102, 175, 233)"})
17+
18+
local-storage: {"rustdoc-theme": "ayu"}
19+
reload:
20+
21+
assert-css: (".search-input", {"border-color": "rgb(66, 76, 87)"})
22+
click: ".search-input"
23+
assert-css: (".search-input", {"border-color": "rgb(66, 76, 87)"})

src/test/rustdoc-gui/search-result-display.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ assert-css: (".search-results div.desc", {"width": "570px"})
1818
size: (900, 900)
1919

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

0 commit comments

Comments
 (0)