@@ -564,7 +564,7 @@ ul.block, .block li {
564
564
/* extend click target to far edge of screen (mile wide bar) */
565
565
border-left : solid var (--sidebar-elems-left-padding ) transparent;
566
566
margin-left : calc (-0.25rem - var (--sidebar-elems-left-padding ));
567
- background-clip : padding -box;
567
+ background-clip : border -box;
568
568
}
569
569
570
570
.sidebar h2 {
@@ -641,11 +641,50 @@ ul.block, .block li {
641
641
text-align : center;
642
642
}
643
643
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
+
644
683
.sidebar-crate h2 a {
645
684
display : block;
646
685
/* extend click target to far edge of screen (mile wide bar) */
647
686
border-left : solid var (--sidebar-elems-left-padding ) transparent;
648
- background-clip : padding -box;
687
+ background-clip : border -box;
649
688
margin : 0 calc (-24px + 0.25rem ) 0 calc (-0.2rem - var (--sidebar-elems-left-padding ));
650
689
/* Align the sidebar crate link with the search bar, which have different
651
690
font sizes.
0 commit comments