@@ -177,6 +177,9 @@ h1, h2, h3, h4 {
177
177
more aggressively when we want them to. */
178
178
overflow-wrap : anywhere;
179
179
}
180
+ .search-results-main-heading nav .sub {
181
+ grid-area : main-heading-h1;
182
+ }
180
183
.main-heading {
181
184
position : relative;
182
185
display : grid;
@@ -197,6 +200,16 @@ h1, h2, h3, h4 {
197
200
align-items : end;
198
201
padding-top : 5px ;
199
202
}
203
+ .search-switcher {
204
+ grid-area : main-heading-breadcrumbs;
205
+ line-height : 1.25 ;
206
+ display : flex;
207
+ flex-wrap : wrap;
208
+ color : var (--main-color );
209
+ align-items : baseline;
210
+ white-space : nowrap;
211
+ margin-top : -1px ;
212
+ }
200
213
.rustdoc-breadcrumbs a {
201
214
padding : 4px 0 ;
202
215
margin : -4px 0 ;
@@ -251,6 +264,7 @@ rustdoc-toolbar,
251
264
summary .hideme ,
252
265
.scraped-example-list ,
253
266
.rustdoc-breadcrumbs ,
267
+ .search-switcher ,
254
268
/* This selector is for the items listed in the "all items" page. */
255
269
ul .all-items {
256
270
font-family : "Fira Sans" , Arial, NanumBarunGothic, sans-serif;
@@ -1002,16 +1016,15 @@ div.where {
1002
1016
nav .sub {
1003
1017
flex-grow : 1 ;
1004
1018
flex-flow : row nowrap;
1005
- margin : 4px 0 0 0 ;
1006
1019
display : flex;
1007
- align-items : center;
1020
+ align-items : start;
1021
+ margin-top : 4px ;
1008
1022
}
1009
1023
.search-form {
1010
1024
position : relative;
1011
1025
display : flex;
1012
1026
height : 34px ;
1013
1027
flex-grow : 1 ;
1014
- margin-bottom : 4px ;
1015
1028
}
1016
1029
.src nav .sub {
1017
1030
margin : 0 0 -10px 0 ;
@@ -1115,21 +1128,6 @@ table,
1115
1128
padding-right : 1.25rem ;
1116
1129
}
1117
1130
1118
- .search-results-title {
1119
- margin-top : 0 ;
1120
- white-space : nowrap;
1121
- /* flex layout allows shrinking the <select> appropriately if it becomes too large */
1122
- display : flex;
1123
- /* make things look like in a line, despite the fact that we're using a layout
1124
- with boxes (i.e. from the flex layout) */
1125
- align-items : baseline;
1126
- }
1127
- .search-results-title + .sub-heading {
1128
- color : var (--main-color );
1129
- display : flex;
1130
- align-items : baseline;
1131
- white-space : nowrap;
1132
- }
1133
1131
# crate-search-div {
1134
1132
/* ensures that 100% in properties of #crate-search-div:after
1135
1133
are relative to the size of this div */
@@ -1854,7 +1852,7 @@ a.tooltip:hover::after {
1854
1852
border-bottom : 1px solid var (--border-color );
1855
1853
}
1856
1854
1857
- # settings-menu , # help-button , button # toggle-all-docs {
1855
+ # search-button , # settings-menu , # help-button , button # toggle-all-docs {
1858
1856
margin-left : var (--button-left-margin );
1859
1857
display : flex;
1860
1858
line-height : 1.25 ;
@@ -1882,7 +1880,11 @@ a.tooltip:hover::after {
1882
1880
.hide-sidebar .src # sidebar-button {
1883
1881
position : static;
1884
1882
}
1885
- # settings-menu > a , # help-button > a , # sidebar-button > a , button # toggle-all-docs {
1883
+ # search-button > a ,
1884
+ # settings-menu > a ,
1885
+ # help-button > a ,
1886
+ # sidebar-button > a ,
1887
+ button # toggle-all-docs {
1886
1888
display : flex;
1887
1889
align-items : center;
1888
1890
justify-content : center;
@@ -1891,11 +1893,11 @@ a.tooltip:hover::after {
1891
1893
border-radius : var (--button-border-radius );
1892
1894
color : var (--main-color );
1893
1895
}
1894
- # settings-menu > a , # help-button > a , button # toggle-all-docs {
1896
+ # search-button > a , # settings-menu > a , # help-button > a , button # toggle-all-docs {
1895
1897
width : 80px ;
1896
1898
border-radius : var (--toolbar-button-border-radius );
1897
1899
}
1898
- # settings-menu > a , # help-button > a {
1900
+ # search-button > a , # settings-menu > a , # help-button > a {
1899
1901
min-width : 0 ;
1900
1902
}
1901
1903
# sidebar-button > a {
@@ -1904,6 +1906,7 @@ a.tooltip:hover::after {
1904
1906
width : 33px ;
1905
1907
}
1906
1908
1909
+ # search-button > a : hover , # search-button > a : focus-visible ,
1907
1910
# settings-menu > a : hover , # settings-menu > a : focus-visible ,
1908
1911
# help-button > a : hover , # help-button > a : focus-visible ,
1909
1912
# sidebar-button > a : hover , # sidebar-button > a : focus-visible ,
@@ -1912,6 +1915,19 @@ button#toggle-all-docs:hover, button#toggle-all-docs:focus-visible {
1912
1915
text-decoration : none;
1913
1916
}
1914
1917
1918
+ # search-button > a : before {
1919
+ /* Magnifying glass */
1920
+ content : url ('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" \
1921
+ width= "18" height="18" viewBox="0 0 16 16 ">\
1922
+ <circle r= " 5 " cy=" 7 " cx=" 6 " style=" fill:none;stroke:currentColor;stroke-width:3"></circle>\
1923
+ <path d= "M 16,15 10,10" style="fill:none;stroke:currentColor;stroke-width:4"></path>\
1924
+ <desc> Search</desc>\
1925
+ </svg>');
1926
+ width : 18px ;
1927
+ height : 18px ;
1928
+ filter : var (--settings-menu-filter );
1929
+ }
1930
+
1915
1931
# settings-menu > a : before {
1916
1932
/* Wheel <https://www.svgrepo.com/svg/384069/settings-cog-gear> */
1917
1933
content : url ('data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 12 12" \
@@ -1954,6 +1970,7 @@ button#toggle-all-docs:before {
1954
1970
filter : var (--settings-menu-filter );
1955
1971
}
1956
1972
1973
+ # search-button > a : before ,
1957
1974
button # toggle-all-docs : before ,
1958
1975
# help-button > a : before ,
1959
1976
# settings-menu > a : before {
@@ -1962,6 +1979,7 @@ button#toggle-all-docs:before,
1962
1979
}
1963
1980
1964
1981
@media not (pointer : coarse) {
1982
+ # search-button > a : hover : before ,
1965
1983
button # toggle-all-docs : hover : before ,
1966
1984
# help-button > a : hover : before ,
1967
1985
# settings-menu > a : hover : before {
@@ -2295,6 +2313,20 @@ However, it's not needed with smaller screen width because the doc/code block is
2295
2313
.side-by-side > div {
2296
2314
width : auto;
2297
2315
}
2316
+
2317
+ /* Text label takes up too much space at this size. */
2318
+ rustdoc-toolbar span .label {
2319
+ display : none;
2320
+ }
2321
+ # search-button > a , # settings-menu > a , # help-button > a , button # toggle-all-docs {
2322
+ width : 33px ;
2323
+ }
2324
+ # settings .popover {
2325
+ --popover-arrow-offset : 86px ;
2326
+ }
2327
+ # help .popover {
2328
+ --popover-arrow-offset : 48px ;
2329
+ }
2298
2330
}
2299
2331
2300
2332
/*
@@ -2325,20 +2357,6 @@ in src-script.js and main.js
2325
2357
visibility : hidden;
2326
2358
}
2327
2359
2328
- /* Text label takes up too much space at this size. */
2329
- rustdoc-toolbar span .label {
2330
- display : none;
2331
- }
2332
- # settings-menu > a , # help-button > a , button # toggle-all-docs {
2333
- width : 33px ;
2334
- }
2335
- # settings .popover {
2336
- --popover-arrow-offset : 86px ;
2337
- }
2338
- # help .popover {
2339
- --popover-arrow-offset : 48px ;
2340
- }
2341
-
2342
2360
.rustdoc {
2343
2361
/* Sidebar should overlay main content, rather than pushing main content to the right.
2344
2362
Turn off `display: flex` on the body element. */
0 commit comments