1515 --desktop-sidebar-width : 200px ;
1616 --src-sidebar-width : 300px ;
1717 --desktop-sidebar-z-index : 100 ;
18+ --sidebar-elems-left-padding : 24px ;
1819}
1920
2021/* See FiraSans-LICENSE.txt for the Fira Sans license. */
@@ -559,8 +560,11 @@ ul.block, .block li {
559560.sidebar > h2 a {
560561 display : block;
561562 padding : 0.25rem ; /* 4px */
562- margin-left : -0.25rem ;
563563 margin-right : 0.25rem ;
564+ /* extend click target to far edge of screen (mile wide bar) */
565+ border-left : solid var (--sidebar-elems-left-padding ) transparent;
566+ margin-left : calc (-0.25rem - var (--sidebar-elems-left-padding ));
567+ background-clip : border-box;
564568}
565569
566570.sidebar h2 {
@@ -578,7 +582,7 @@ ul.block, .block li {
578582.sidebar-elems ,
579583.sidebar > .version ,
580584.sidebar > h2 {
581- padding-left : 24 px ;
585+ padding-left : var ( --sidebar-elems-left-padding ) ;
582586}
583587
584588.sidebar a {
@@ -632,13 +636,56 @@ ul.block, .block li {
632636.sidebar-crate .logo-container {
633637 /* The logo is expected to have 8px "slop" along its edges, so we can optically
634638 center it. */
635- margin : 0 -16px 0 -16px ;
639+ margin : 0 calc (-16px - var (--sidebar-elems-left-padding ));
640+ padding : 0 var (--sidebar-elems-left-padding );
636641 text-align : center;
637642}
638643
644+ .sidebar-crate .logo-container img {
645+ /* When in a horizontal logo lockup, the highlight color of the crate name menu item
646+ extends underneath the actual logo (in a vertical lockup, that background highlight
647+ extends to the left edge of the screen).
648+
649+ To prevent a weird-looking colored band from appearing under the logo, cover it up
650+ with the sidebar's background. Additionally, the crate name extends slightly above
651+ the logo, so that its highlight has a bit of space to let the ascenders breath while
652+ also having those ascenders meet exactly with the top of the logo.
653+
654+ In ANSI art, make it look like this:
655+ | ┌─────┐
656+ | (R) │ std │
657+ | └─────┘
658+
659+ Not like this (which would happen without the z-index):
660+ | ┌────────┐
661+ | (│ std │
662+ | └────────┘
663+
664+ Not like this (which would happen without the background):
665+ | ┌────────┐
666+ | (R) std │
667+ | └────────┘
668+
669+ Nor like this (which would happen without the negative margin):
670+ | ─────────┐
671+ | (R) │ std │
672+ | └─────┘
673+ */
674+ margin-top : -16px ;
675+ border-top : solid 16px transparent;
676+ box-sizing : content-box;
677+ position : relative;
678+ background-color : var (--sidebar-background-color );
679+ background-clip : border-box;
680+ z-index : 1 ;
681+ }
682+
639683.sidebar-crate h2 a {
640684 display : block;
641- margin : 0 calc (-24px + 0.25rem ) 0 -0.2rem ;
685+ /* extend click target to far edge of screen (mile wide bar) */
686+ border-left : solid var (--sidebar-elems-left-padding ) transparent;
687+ background-clip : border-box;
688+ margin : 0 calc (-24px + 0.25rem ) 0 calc (-0.2rem - var (--sidebar-elems-left-padding ));
642689 /* Align the sidebar crate link with the search bar, which have different
643690 font sizes.
644691
0 commit comments