@@ -244,6 +244,9 @@ h1, h2, h3, h4 {
244
244
more aggressively when we want them to. */
245
245
overflow-wrap : anywhere;
246
246
}
247
+ .search-results-main-heading nav .sub {
248
+ grid-area : main-heading-h1;
249
+ }
247
250
.main-heading {
248
251
position : relative;
249
252
display : grid;
@@ -263,6 +266,16 @@ h1, h2, h3, h4 {
263
266
position : relative;
264
267
z-index : 1 ;
265
268
}
269
+ .search-switcher {
270
+ grid-area : main-heading-breadcrumbs;
271
+ line-height : 1.25 ;
272
+ display : flex;
273
+ flex-wrap : wrap;
274
+ color : var (--main-color );
275
+ align-items : baseline;
276
+ white-space : nowrap;
277
+ margin-top : -1px ;
278
+ }
266
279
.rustdoc-breadcrumbs a {
267
280
padding : 5px 0 7px ;
268
281
}
@@ -315,6 +328,7 @@ rustdoc-toolbar,
315
328
summary .hideme ,
316
329
.scraped-example-list ,
317
330
.rustdoc-breadcrumbs ,
331
+ .search-switcher ,
318
332
/* This selector is for the items listed in the "all items" page. */
319
333
ul .all-items {
320
334
font-family : "Fira Sans" , Arial, NanumBarunGothic, sans-serif;
@@ -1136,16 +1150,15 @@ div.where {
1136
1150
nav .sub {
1137
1151
flex-grow : 1 ;
1138
1152
flex-flow : row nowrap;
1139
- margin : 4px 0 0 0 ;
1140
1153
display : flex;
1141
- align-items : center;
1154
+ align-items : start;
1155
+ margin-top : 4px ;
1142
1156
}
1143
1157
.search-form {
1144
1158
position : relative;
1145
1159
display : flex;
1146
1160
height : 34px ;
1147
1161
flex-grow : 1 ;
1148
- margin-bottom : 4px ;
1149
1162
}
1150
1163
.src nav .sub {
1151
1164
margin : 0 0 -10px 0 ;
@@ -1246,21 +1259,6 @@ table,
1246
1259
margin-left : 0 ;
1247
1260
}
1248
1261
1249
- .search-results-title {
1250
- margin-top : 0 ;
1251
- white-space : nowrap;
1252
- /* flex layout allows shrinking the <select> appropriately if it becomes too large */
1253
- display : flex;
1254
- /* make things look like in a line, despite the fact that we're using a layout
1255
- with boxes (i.e. from the flex layout) */
1256
- align-items : baseline;
1257
- }
1258
- .search-results-title + .sub-heading {
1259
- color : var (--main-color );
1260
- display : flex;
1261
- align-items : baseline;
1262
- white-space : nowrap;
1263
- }
1264
1262
# crate-search-div {
1265
1263
/* ensures that 100% in properties of #crate-search-div:after
1266
1264
are relative to the size of this div */
@@ -2008,7 +2006,7 @@ a.tooltip:hover::after {
2008
2006
border-bottom : 1px solid var (--border-color );
2009
2007
}
2010
2008
2011
- # settings-menu , # help-button , button # toggle-all-docs {
2009
+ # search-button , # settings-menu , # help-button , button # toggle-all-docs {
2012
2010
margin-left : var (--button-left-margin );
2013
2011
display : flex;
2014
2012
line-height : 1.25 ;
@@ -2038,7 +2036,11 @@ a.tooltip:hover::after {
2038
2036
.hide-sidebar .src # sidebar-button {
2039
2037
position : static;
2040
2038
}
2041
- # settings-menu > a , # help-button > a , # sidebar-button > a , button # toggle-all-docs {
2039
+ # search-button > a ,
2040
+ # settings-menu > a ,
2041
+ # help-button > a ,
2042
+ # sidebar-button > a ,
2043
+ button # toggle-all-docs {
2042
2044
display : flex;
2043
2045
align-items : center;
2044
2046
justify-content : center;
@@ -2049,11 +2051,11 @@ a.tooltip:hover::after {
2049
2051
border-radius : var (--button-border-radius );
2050
2052
color : var (--main-color );
2051
2053
}
2052
- # settings-menu > a , # help-button > a , button # toggle-all-docs {
2054
+ # search-button > a , # settings-menu > a , # help-button > a , button # toggle-all-docs {
2053
2055
width : 80px ;
2054
2056
border-radius : var (--toolbar-button-border-radius );
2055
2057
}
2056
- # settings-menu > a , # help-button > a {
2058
+ # search-button > a , # settings-menu > a , # help-button > a {
2057
2059
min-width : 0 ;
2058
2060
}
2059
2061
# sidebar-button > a {
@@ -2064,13 +2066,27 @@ a.tooltip:hover::after {
2064
2066
background-color : var (--main-background-color );
2065
2067
}
2066
2068
2069
+ # search-button > a : hover , # search-button > a : focus-visible ,
2067
2070
# settings-menu > a : hover , # settings-menu > a : focus-visible ,
2068
2071
# help-button > a : hover , # help-button > a : focus-visible ,
2069
2072
button # toggle-all-docs : hover , button # toggle-all-docs : focus-visible {
2070
2073
border-color : var (--settings-button-border-focus );
2071
2074
text-decoration : none;
2072
2075
}
2073
2076
2077
+ # search-button > a ::before {
2078
+ /* Magnifying glass */
2079
+ content : url ('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" \
2080
+ width= "18" height="18" viewBox="0 0 16 16 ">\
2081
+ <circle r= " 5 " cy=" 7 " cx=" 6 " style=" fill:none;stroke:currentColor;stroke-width:3"></circle>\
2082
+ <path d= "M 16,15 10,10" style="fill:none;stroke:currentColor;stroke-width:4"></path>\
2083
+ <desc> Search</desc>\
2084
+ </svg>');
2085
+ width : 18px ;
2086
+ height : 18px ;
2087
+ filter : var (--settings-menu-filter );
2088
+ }
2089
+
2074
2090
# settings-menu > a ::before {
2075
2091
/* Wheel <https://www.svgrepo.com/svg/384069/settings-cog-gear> */
2076
2092
content : url ('data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 12 12" \
@@ -2120,6 +2136,7 @@ button#toggle-all-docs.will-expand::before {
2120
2136
filter : var (--settings-menu-filter );
2121
2137
}
2122
2138
2139
+ # search-button > a ::before ,
2123
2140
button # toggle-all-docs ::before ,
2124
2141
# help-button > a ::before ,
2125
2142
# settings-menu > a ::before {
@@ -2128,6 +2145,7 @@ button#toggle-all-docs::before,
2128
2145
}
2129
2146
2130
2147
@media not (pointer : coarse) {
2148
+ # search-button > a : hover ::before ,
2131
2149
button # toggle-all-docs : hover ::before ,
2132
2150
# help-button > a : hover ::before ,
2133
2151
# settings-menu > a : hover ::before {
@@ -2455,6 +2473,20 @@ However, it's not needed with smaller screen width because the doc/code block is
2455
2473
.side-by-side > div {
2456
2474
width : auto;
2457
2475
}
2476
+
2477
+ /* Text label takes up too much space at this size. */
2478
+ rustdoc-toolbar span .label {
2479
+ display : none;
2480
+ }
2481
+ # search-button > a , # settings-menu > a , # help-button > a , button # toggle-all-docs {
2482
+ width : 33px ;
2483
+ }
2484
+ # settings .popover {
2485
+ --popover-arrow-offset : 86px ;
2486
+ }
2487
+ # help .popover {
2488
+ --popover-arrow-offset : 48px ;
2489
+ }
2458
2490
}
2459
2491
2460
2492
/*
@@ -2485,20 +2517,6 @@ in src-script.js and main.js
2485
2517
visibility : hidden;
2486
2518
}
2487
2519
2488
- /* Text label takes up too much space at this size. */
2489
- rustdoc-toolbar span .label {
2490
- display : none;
2491
- }
2492
- # settings-menu > a , # help-button > a , button # toggle-all-docs {
2493
- width : 33px ;
2494
- }
2495
- # settings .popover {
2496
- --popover-arrow-offset : 86px ;
2497
- }
2498
- # help .popover {
2499
- --popover-arrow-offset : 48px ;
2500
- }
2501
-
2502
2520
.rustdoc {
2503
2521
/* Sidebar should overlay main content, rather than pushing main content to the right.
2504
2522
Turn off `display: flex` on the body element. */
0 commit comments