@@ -366,22 +366,12 @@ img {
366366 max-width : 100% ;
367367}
368368
369- .sub-logo-container , . logo-container {
369+ .logo-container {
370370 /* zero text boxes so that computed line height = image height exactly */
371371 line-height : 0 ;
372372 display : block;
373373}
374374
375- .sub-logo-container {
376- margin-right : 32px ;
377- }
378-
379- .sub-logo-container > img {
380- height : 60px ;
381- width : 60px ;
382- object-fit : contain;
383- }
384-
385375.rust-logo {
386376 filter : var (--rust-logo-filter );
387377}
@@ -424,14 +414,14 @@ img {
424414}
425415
426416.rustdoc .src .sidebar-resizer {
427- /* when closed, place resizer glow on top of the normal src sidebar border (no need to worry
428- about sidebar) */
429- left : 49px ;
417+ /* src pages have separate closed flag */
418+ display : none;
430419}
431420
432- .src-sidebar-expanded .rustdoc . src .sidebar-resizer {
421+ .src-sidebar-expanded .src .sidebar-resizer {
433422 /* for src sidebar, gap is already provided by 1px border on sidebar itself, so place resizer
434423 to right of it */
424+ display : block;
435425 left : var (--src-sidebar-width );
436426}
437427
@@ -447,7 +437,7 @@ img {
447437}
448438
449439.sidebar-resizing .sidebar {
450- position : fixed;
440+ position : fixed !important ;
451441 z-index : 100 ;
452442}
453443.sidebar-resizing > body {
@@ -497,28 +487,25 @@ img {
497487}
498488
499489.sidebar , .mobile-topbar , .sidebar-menu-toggle ,
500- # src-sidebar-toggle , # src-sidebar {
490+ # src-sidebar {
501491 background-color : var (--sidebar-background-color );
502492}
503493
504- # src-sidebar-toggle > button : hover , # src-sidebar-toggle > button : focus {
505- background-color : var (--sidebar-background-color-hover );
506- }
507-
508- .src .sidebar > * : not (# src-sidebar-toggle ) {
509- visibility : hidden;
494+ .src .sidebar {
495+ position : absolute;
496+ top : 0 ;
497+ bottom : 0 ;
498+ left : -1000px ;
510499}
511500
512501.src-sidebar-expanded .src .sidebar {
502+ position : sticky;
503+ left : 0 ;
513504 overflow-y : auto;
514505 flex-basis : var (--src-sidebar-width );
515506 width : var (--src-sidebar-width );
516507}
517508
518- .src-sidebar-expanded .src .sidebar > * : not (# src-sidebar-toggle ) {
519- visibility : visible;
520- }
521-
522509# all-types {
523510 margin-top : 1em ;
524511}
@@ -1528,18 +1515,6 @@ a.tooltip:hover::after {
15281515 font-weight : normal;
15291516}
15301517
1531- # src-sidebar-toggle {
1532- position : sticky;
1533- top : 0 ;
1534- left : 0 ;
1535- font-size : 1.25rem ;
1536- border-bottom : 1px solid;
1537- display : flex;
1538- height : 40px ;
1539- justify-content : stretch;
1540- align-items : stretch;
1541- z-index : 10 ;
1542- }
15431518# src-sidebar {
15441519 width : 100% ;
15451520 overflow : auto;
@@ -1557,18 +1532,14 @@ a.tooltip:hover::after {
15571532# src-sidebar div .files > a .selected {
15581533 background-color : var (--src-sidebar-background-selected );
15591534}
1560- # src-sidebar-toggle > button {
1561- font-size : inherit;
1562- font-weight : bold;
1563- background : none;
1564- color : inherit;
1565- text-align : center;
1566- border : none;
1567- outline : none;
1568- flex : 1 1 ;
1569- /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1570- -webkit-appearance : none;
1571- opacity : 1 ;
1535+
1536+ .src-sidebar-title {
1537+ position : sticky;
1538+ top : 0 ;
1539+ display : flex;
1540+ padding : 8px ;
1541+ padding-left : 48px ;
1542+ background : var (--sidebar-background-color );
15721543}
15731544
15741545# settings-menu , # help-button {
@@ -1578,7 +1549,8 @@ a.tooltip:hover::after {
15781549# sidebar-button {
15791550 display : none;
15801551}
1581- .hide-sidebar # sidebar-button {
1552+ .hide-sidebar # sidebar-button ,
1553+ .src # sidebar-button {
15821554 display : flex;
15831555 margin-right : 4px ;
15841556 position : fixed;
@@ -1588,6 +1560,16 @@ a.tooltip:hover::after {
15881560 background-color : var (--main-background-color );
15891561 z-index : 1 ;
15901562}
1563+ .src # sidebar-button {
1564+ left : 12px ;
1565+ z-index : 101 ;
1566+ }
1567+ .src .search-form {
1568+ margin-left : 40px ;
1569+ }
1570+ .src-sidebar-expanded .src .search-form {
1571+ margin-left : 0 ;
1572+ }
15911573# settings-menu > a , # help-button > a , # sidebar-button > a {
15921574 display : flex;
15931575 align-items : center;
@@ -1843,10 +1825,6 @@ in src-script.js and main.js
18431825 scroll-margin-top : 45px ;
18441826 }
18451827
1846- .hide-sidebar # sidebar-button {
1847- position : static;
1848- }
1849-
18501828 .rustdoc {
18511829 /* Sidebar should overlay main content, rather than pushing main content to the right.
18521830 Turn off `display: flex` on the body element. */
@@ -1974,31 +1952,6 @@ in src-script.js and main.js
19741952 left : -11px ;
19751953 }
19761954
1977- # src-sidebar-toggle {
1978- position : fixed;
1979- left : 1px ;
1980- top : 100px ;
1981- width : 30px ;
1982- font-size : 1.5rem ;
1983- padding : 0 ;
1984- z-index : 10 ;
1985- border-top-right-radius : 3px ;
1986- border-bottom-right-radius : 3px ;
1987- border : 1px solid;
1988- border-left : 0 ;
1989- }
1990-
1991- .src-sidebar-expanded # src-sidebar-toggle {
1992- left : unset;
1993- top : unset;
1994- width : unset;
1995- border-top-right-radius : unset;
1996- border-bottom-right-radius : unset;
1997- position : sticky;
1998- border : 0 ;
1999- border-bottom : 1px solid;
2000- }
2001-
20021955 /* We don't display these buttons on mobile devices. */
20031956 # copy-path , # help-button {
20041957 display : none;
@@ -2015,6 +1968,14 @@ in src-script.js and main.js
20151968 height : 22px ;
20161969 }
20171970
1971+ /* src sidebar button opens modal
1972+ use hamburger button */
1973+ .src # sidebar-button > a : before {
1974+ content : url ('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" \
1975+ viewBox= "0 0 22 22" fill="none" stroke="black">\
1976+ <path d= "M3,5h16M3,11h16M3,17h16" stroke-width="3"/></svg>');
1977+ }
1978+
20181979 /* Display an alternating layout on tablets and phones */
20191980 .item-table , .item-row , .item-table > li , .item-table > li > div ,
20201981 .search-results > a , .search-results > a > div {
@@ -2040,9 +2001,19 @@ in src-script.js and main.js
20402001 }
20412002
20422003 .src-sidebar-expanded .src .sidebar {
2004+ position : fixed;
20432005 max-width : 100vw ;
20442006 width : 100vw ;
20452007 }
2008+ .src .src-sidebar-title {
2009+ padding-top : 0 ;
2010+ }
2011+ .hide-sidebar # sidebar-button {
2012+ position : static;
2013+ }
2014+ .src # sidebar-button {
2015+ position : fixed;
2016+ }
20462017
20472018 /* Position of the "[-]" element. */
20482019 details .toggle : not (.top-doc ) > summary {
@@ -2114,12 +2085,6 @@ in src-script.js and main.js
21142085 .search-form {
21152086 align-self : stretch;
21162087 }
2117-
2118- .sub-logo-container > img {
2119- height : 35px ;
2120- width : 35px ;
2121- margin-bottom : var (--nav-sub-mobile-padding );
2122- }
21232088}
21242089
21252090.variant ,
0 commit comments