@@ -175,6 +175,9 @@ h1, h2, h3, h4 {
175
175
more aggressively when we want them to. */
176
176
overflow-wrap : anywhere;
177
177
}
178
+ .search-results-main-heading nav .sub {
179
+ grid-area : main-heading-h1;
180
+ }
178
181
.main-heading {
179
182
position : relative;
180
183
display : grid;
@@ -195,6 +198,16 @@ h1, h2, h3, h4 {
195
198
align-items : end;
196
199
padding-top : 5px ;
197
200
}
201
+ .search-switcher {
202
+ grid-area : main-heading-breadcrumbs;
203
+ line-height : 1.25 ;
204
+ display : flex;
205
+ flex-wrap : wrap;
206
+ color : var (--main-color );
207
+ align-items : baseline;
208
+ white-space : nowrap;
209
+ margin-top : -1px ;
210
+ }
198
211
.rustdoc-breadcrumbs a {
199
212
padding : 4px 0 ;
200
213
margin : -4px 0 ;
@@ -249,6 +262,7 @@ rustdoc-toolbar,
249
262
summary .hideme ,
250
263
.scraped-example-list ,
251
264
.rustdoc-breadcrumbs ,
265
+ .search-switcher ,
252
266
/* This selector is for the items listed in the "all items" page. */
253
267
ul .all-items {
254
268
font-family : "Fira Sans" , Arial, NanumBarunGothic, sans-serif;
@@ -996,16 +1010,15 @@ div.where {
996
1010
nav .sub {
997
1011
flex-grow : 1 ;
998
1012
flex-flow : row nowrap;
999
- margin : 4px 0 0 0 ;
1000
1013
display : flex;
1001
- align-items : center;
1014
+ align-items : start;
1015
+ margin-top : 4px ;
1002
1016
}
1003
1017
.search-form {
1004
1018
position : relative;
1005
1019
display : flex;
1006
1020
height : 34px ;
1007
1021
flex-grow : 1 ;
1008
- margin-bottom : 4px ;
1009
1022
}
1010
1023
.src nav .sub {
1011
1024
margin : 0 0 -10px 0 ;
@@ -1109,21 +1122,6 @@ table,
1109
1122
padding-right : 1.25rem ;
1110
1123
}
1111
1124
1112
- .search-results-title {
1113
- margin-top : 0 ;
1114
- white-space : nowrap;
1115
- /* flex layout allows shrinking the <select> appropriately if it becomes too large */
1116
- display : flex;
1117
- /* make things look like in a line, despite the fact that we're using a layout
1118
- with boxes (i.e. from the flex layout) */
1119
- align-items : baseline;
1120
- }
1121
- .search-results-title + .sub-heading {
1122
- color : var (--main-color );
1123
- display : flex;
1124
- align-items : baseline;
1125
- white-space : nowrap;
1126
- }
1127
1125
# crate-search-div {
1128
1126
/* ensures that 100% in properties of #crate-search-div:after
1129
1127
are relative to the size of this div */
@@ -1848,7 +1846,7 @@ a.tooltip:hover::after {
1848
1846
border-bottom : 1px solid var (--border-color );
1849
1847
}
1850
1848
1851
- # settings-menu , # help-button , button # toggle-all-docs {
1849
+ # search-button , # settings-menu , # help-button , button # toggle-all-docs {
1852
1850
margin-left : var (--button-left-margin );
1853
1851
display : flex;
1854
1852
line-height : 1.25 ;
@@ -1876,7 +1874,11 @@ a.tooltip:hover::after {
1876
1874
.hide-sidebar .src # sidebar-button {
1877
1875
position : static;
1878
1876
}
1879
- # settings-menu > a , # help-button > a , # sidebar-button > a , button # toggle-all-docs {
1877
+ # search-button > a ,
1878
+ # settings-menu > a ,
1879
+ # help-button > a ,
1880
+ # sidebar-button > a ,
1881
+ button # toggle-all-docs {
1880
1882
display : flex;
1881
1883
align-items : center;
1882
1884
justify-content : center;
@@ -1885,11 +1887,11 @@ a.tooltip:hover::after {
1885
1887
border-radius : var (--button-border-radius );
1886
1888
color : var (--main-color );
1887
1889
}
1888
- # settings-menu > a , # help-button > a , button # toggle-all-docs {
1890
+ # search-button > a , # settings-menu > a , # help-button > a , button # toggle-all-docs {
1889
1891
width : 80px ;
1890
1892
border-radius : var (--toolbar-button-border-radius );
1891
1893
}
1892
- # settings-menu > a , # help-button > a {
1894
+ # search-button > a , # settings-menu > a , # help-button > a {
1893
1895
min-width : 0 ;
1894
1896
}
1895
1897
# sidebar-button > a {
@@ -1898,6 +1900,7 @@ a.tooltip:hover::after {
1898
1900
width : 33px ;
1899
1901
}
1900
1902
1903
+ # search-button > a : hover , # search-button > a : focus-visible ,
1901
1904
# settings-menu > a : hover , # settings-menu > a : focus-visible ,
1902
1905
# help-button > a : hover , # help-button > a : focus-visible ,
1903
1906
# sidebar-button > a : hover , # sidebar-button > a : focus-visible ,
@@ -1906,6 +1909,19 @@ button#toggle-all-docs:hover, button#toggle-all-docs:focus-visible {
1906
1909
text-decoration : none;
1907
1910
}
1908
1911
1912
+ # search-button > a : before {
1913
+ /* Magnifying glass */
1914
+ content : url ('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" \
1915
+ width= "18" height="18" viewBox="0 0 16 16 ">\
1916
+ <circle r= " 5 " cy=" 7 " cx=" 6 " style=" fill:none;stroke:currentColor;stroke-width:3"></circle>\
1917
+ <path d= "M 16,15 10,10" style="fill:none;stroke:currentColor;stroke-width:4"></path>\
1918
+ <desc> Search</desc>\
1919
+ </svg>');
1920
+ width : 18px ;
1921
+ height : 18px ;
1922
+ filter : var (--settings-menu-filter );
1923
+ }
1924
+
1909
1925
# settings-menu > a : before {
1910
1926
/* Wheel <https://www.svgrepo.com/svg/384069/settings-cog-gear> */
1911
1927
content : url ('data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 12 12" \
@@ -1948,6 +1964,7 @@ button#toggle-all-docs:before {
1948
1964
filter : var (--settings-menu-filter );
1949
1965
}
1950
1966
1967
+ # search-button > a : before ,
1951
1968
button # toggle-all-docs : before ,
1952
1969
# help-button > a : before ,
1953
1970
# settings-menu > a : before {
@@ -1956,6 +1973,7 @@ button#toggle-all-docs:before,
1956
1973
}
1957
1974
1958
1975
@media not (pointer : coarse) {
1976
+ # search-button > a : hover : before ,
1959
1977
button # toggle-all-docs : hover : before ,
1960
1978
# help-button > a : hover : before ,
1961
1979
# settings-menu > a : hover : before {
@@ -2247,6 +2265,20 @@ However, it's not needed with smaller screen width because the doc/code block is
2247
2265
.side-by-side > div {
2248
2266
width : auto;
2249
2267
}
2268
+
2269
+ /* Text label takes up too much space at this size. */
2270
+ rustdoc-toolbar span .label {
2271
+ display : none;
2272
+ }
2273
+ # search-button > a , # settings-menu > a , # help-button > a , button # toggle-all-docs {
2274
+ width : 33px ;
2275
+ }
2276
+ # settings .popover {
2277
+ --popover-arrow-offset : 86px ;
2278
+ }
2279
+ # help .popover {
2280
+ --popover-arrow-offset : 48px ;
2281
+ }
2250
2282
}
2251
2283
2252
2284
/*
@@ -2273,20 +2305,6 @@ in src-script.js and main.js
2273
2305
visibility : hidden;
2274
2306
}
2275
2307
2276
- /* Text label takes up too much space at this size. */
2277
- rustdoc-toolbar span .label {
2278
- display : none;
2279
- }
2280
- # settings-menu > a , # help-button > a , button # toggle-all-docs {
2281
- width : 33px ;
2282
- }
2283
- # settings .popover {
2284
- --popover-arrow-offset : 86px ;
2285
- }
2286
- # help .popover {
2287
- --popover-arrow-offset : 48px ;
2288
- }
2289
-
2290
2308
.rustdoc {
2291
2309
/* Sidebar should overlay main content, rather than pushing main content to the right.
2292
2310
Turn off `display: flex` on the body element. */
0 commit comments