Skip to content

Commit cb6972b

Browse files
committed
Styles: Sidebar style refresh
1 parent 532c1c6 commit cb6972b

File tree

9 files changed

+150
-181
lines changed

9 files changed

+150
-181
lines changed

assets/css/v2/style.css

Lines changed: 44 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@
8383
--code-copy-icon-height: 1rem;
8484
--code-copy-icon-width: 1rem;
8585
--breadcrumb-max-height: 54px;
86-
--sidebar-margin: 24px;
86+
--sidebar-margin: 1.5rem;
8787
--sidebar-line-box-side-length: 8px;
8888
--sidebar-line-box-top: 6px;
8989
--sidebar-line-box-left: 12px;
90-
--sidebar-width: 24rem;
90+
--sidebar-width: 22rem;
9191
--sidebar-line-width: 11.5px;
9292
--side-gutter-width: 20rem;
9393
--table-top-bottom-spacing: 1rem;
@@ -617,12 +617,17 @@ body:not(:has(.main-layout)) header atomic-search-interface {
617617
.sidebar {
618618
display: flex;
619619
flex-direction: column;
620-
width: 24rem;
620+
width: var(--sidebar-width);
621621
max-height: 100vh;
622622
position: sticky;
623623
top: 0;
624-
margin-top: -1rem;
625-
padding-top: 1rem;
624+
padding: 1rem 1rem 0 1rem;
625+
}
626+
627+
/* reset */
628+
.sidebar ul, .sidebar li {
629+
margin: 0;
630+
padding: 0;
626631
}
627632

628633
.sidebar .product-selector-button {
@@ -647,9 +652,9 @@ body:not(:has(.main-layout)) header atomic-search-interface {
647652
display: none;
648653
position: absolute;
649654
top: 0;
650-
min-width: 80%;
655+
min-width: 20rem;
651656
margin-top: 8.375rem;
652-
margin-left: 44rem;
657+
margin-left: calc(var(--sidebar-width) + 20rem);
653658
padding: 1rem 1.5rem;
654659
background-color: white;
655660
border: black 1px solid;
@@ -688,19 +693,16 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
688693
.sidebar .scrollbar-container {
689694
width: 100%;
690695
max-height: 100vh;
691-
overflow: scroll;
696+
overflow: auto;
692697
scrollbar-gutter: stable;
693-
scrollbar-width: none;
698+
scrollbar-width: thin;
699+
font-size: 0.875rem;
694700
}
695701

696702
.sidebar .scrollbar-container:hover {
697703
overflow: auto;
698704
}
699705

700-
.sidebar .sidebar-navigation {
701-
margin-left: var(--sidebar-margin);
702-
}
703-
704706
/* removes the built in ul padding/margin */
705707
.sidebar .sidebar-navigation ul {
706708
margin-left: 0;
@@ -709,19 +711,18 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
709711
}
710712

711713
.sidebar ul :not(.sidebar-navigation) ul {
712-
padding-left: 16px;
714+
/* padding-left: 0.25rem; */
713715
}
714716

715717
.sidebar .sidebar-navigation li {
716-
margin-bottom: 16px;
717718
}
718719

719720
.sidebar .sidebar-navigation a {
720721
text-decoration: none;
721-
color: black;
722722
}
723723

724724
.sidebar .sidebar-navigation .collapsible-header {
725+
display: block;
725726
cursor: pointer;
726727
}
727728

@@ -752,162 +753,37 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
752753
display: block;
753754
}
754755

755-
/* Every other Sidebar Partial Vertical Line */
756-
.toggle-checkbox:checked ~ .collapsible-content::before {
757-
content: "";
758-
position: absolute;
759-
border-left: black 1px solid;
760-
left: -8.5px;
761-
top: -22.5px;
762-
height: calc(100% + 13.5px);
763-
}
764-
765-
/* Every other Sidebar Partial Horizontal Lines */
766-
.toggle-checkbox:checked ~ .collapsible-content li {
767-
position: relative;
768-
}
769-
770-
.collapsible-content .box::after {
771-
content: "";
772-
position: absolute;
773-
border-top: black 1px solid;
774-
left: -11.5px;
775-
width: var(--sidebar-line-width);
776-
top: 50%;
777-
}
778-
779-
.collapsible-content .opened::after {
780-
content: "";
781-
position: absolute;
782-
border-top: black 1px solid;
783-
left: -12.5px;
784-
width: var(--sidebar-line-width);
785-
top: 50%;
786-
}
787-
788-
.collapsible-content .box-link::after {
789-
content: "";
790-
position: absolute;
791-
border-top: black 1px solid;
792-
left: -11.5px;
793-
width: var(--sidebar-line-width);
794-
top: 50%;
795-
}
796-
797-
.selected {
798-
font-weight: 800;
799-
}
800-
801-
.sidebar .sidebar-navigation li:first-child {
802-
margin-top: 16px;
803-
}
804-
805-
.sidebar .sidebar-navigation ul li .parent-box-link {
806-
content: "";
807-
background-color: black;
808-
position: absolute;
809-
width: 1px;
810-
height: var(--sidebar-line-box-side-length);
811-
margin-top: var(--sidebar-line-box-top);
812-
left: calc(0px - var(--sidebar-line-box-left));
813-
}
814-
815-
.sidebar .sidebar-navigation ul li .box-link {
816-
content: "";
817-
background-color: black;
818-
position: absolute;
819-
width: 1px;
820-
height: var(--sidebar-line-box-side-length);
821-
margin-top: var(--sidebar-line-box-top);
822-
left: var(--sidebar-line-box-left);
823-
}
824-
825-
.sidebar .sidebar-navigation ul li .parent-box {
826-
content: "";
827-
display: inline-block;
828-
width: var(--sidebar-line-box-side-length);
829-
height: var(--sidebar-line-box-side-length);
830-
vertical-align: middle;
831-
margin-left: -12px;
832-
margin-top: -4px;
833-
}
834-
835-
.sidebar .sidebar-navigation ul li .box {
836-
content: "";
837-
position: absolute;
838-
width: var(--sidebar-line-box-side-length);
839-
height: var(--sidebar-line-box-side-length);
840-
margin-top: var(--sidebar-line-box-top);
841-
left: var(--sidebar-line-box-left);
842-
}
843-
844-
.sidebar .sidebar-navigation ul li .expand {
845-
background-color: black;
846-
}
847-
848-
.sidebar .sidebar-navigation ul li .opened {
849-
border: black 1px solid;
850-
}
851-
852-
.sidebar .sidebar-navigation ul li .current {
853-
background-color: oklch(var(--color-brand));
854-
}
855-
856-
.sidebar .sidebar-navigation ul li .partial-box {
857-
margin-left: -24px;
756+
ul.collapsible-content {
757+
padding: 0.25rem 0;
858758
}
859759

860-
.sidebar .sidebar-navigation ul li .partial {
861-
margin-top: 0;
862-
top: 5px;
863-
left: -13px;
864-
}
760+
li.parent-collapsible-content-item {
761+
padding: 0.5rem 0 0.4rem 0;
762+
font-weight: 450;
865763

866-
/* First Sidebar Nav Vertical Line */
867-
.sidebar .sidebar-navigation .parent-collapsible-content {
868-
position: relative;
764+
a, label {
765+
color: black;
766+
display: block;
767+
}
869768
}
870769

871-
.sidebar .sidebar-navigation .parent-collapsible-content:first-child::before {
872-
content: "";
873-
position: absolute;
874-
border-left: black 1px solid;
875-
left: -24px;
876-
top: 10px;
877-
height: calc(100% - 9px - 10px);
878-
}
879-
880-
.sidebar
881-
.sidebar-navigation
882-
.parent-collapsible-content
883-
li:not(:only-child)
884-
a
885-
+ :not(:has(#TableOfContents))
886-
li::before {
887-
border: none;
888-
}
770+
ul.collapsible-content > li > a,
771+
#TableOfContents ul > li > a {
772+
padding: 0.25rem 0.75rem;
773+
margin: 2px 0.5rem 2px 0;
774+
border-radius: 5px;
889775

890-
/* First Sidebar Nav Horizontal Lines */
891-
.sidebar
892-
.sidebar-navigation
893-
.parent-collapsible-content
894-
li:not(:only-child)
895-
.parent-box::before {
896-
content: "";
897-
display: block;
898-
border-top: black 1px solid;
899-
margin-left: -12px;
900-
margin-top: 50%;
901-
width: var(--sidebar-line-width);
776+
color: oklch(0 0 0 / 0.75);
777+
778+
&.current {
779+
color: oklch(var(--color-brand) / 1);
780+
background-color: oklch(var(--color-brand) / 0.1);
781+
}
902782
}
903783

904-
.parent-collapsible-content .parent-box-link::after {
905-
content: "";
906-
position: absolute;
907-
border-top: black 1px solid;
908-
left: -11.5px;
909-
width: var(--sidebar-line-width);
910-
top: 50%;
784+
ul.collapsible-content .current,
785+
ul.parent-collapsible-content .current {
786+
font-weight: 600;
911787
}
912788

913789
.row {
@@ -917,9 +793,8 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
917793
}
918794

919795
/* Table of Contents */
920-
#TableOfContents {
921-
/* Close all TOC on sidebar */
922-
display: none;
796+
#TableOfContents ul {
797+
padding: 0 0 0.5rem 0.75rem;
923798
}
924799

925800
.collapsible-content li ul li:has(.current) > nav {
@@ -928,16 +803,15 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
928803
}
929804

930805
#TableOfContents li:not(:empty) {
931-
position: relative;
932-
list-style: square;
806+
list-style: none;
933807
}
934808

935809
/* MARK: Content
936810
*/
937811
main {
938812
flex: 1;
939813
min-width: 20rem;
940-
margin: 0 2rem 2rem 2rem;
814+
margin: 0 2rem 2rem 0;
941815
}
942816

943817
p {

exampleSite/content/test-product/call-out/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ title: Call Out usages
44
weight: 100
55
toc: true
66
---
7+
8+
This is a landing page for callout usages. It replaces the default list page.

exampleSite/content/test-product/call-out/all-callouts.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
description: All Callouts
44
title: All Callouts
55
weight: 100
6+
toc: true
67
---
78

89

@@ -18,12 +19,12 @@ This is a plain callout with a title. It has a [link](#plain-callouts) to a head
1819
{{</call-out>}}
1920

2021
{{<before-you-begin>}}
21-
This is a plain callout with a default title for its type. It has a [link](#plain-callouts) to a heading on this page. Its shortcode is `<before-you-begin>`.
22+
This is a plain `callout` with a default title for its type. It has a [link](#plain-callouts) to a heading on this page. Its shortcode is `<before-you-begin>`.
2223
{{</before-you-begin>}}
2324

2425
## Side Callouts
2526

26-
Naturally, callouts should contain less text within them than the text it lives next to. We do this for several reasons. Firstly, it looks weird to have a big empty space in the primary content area. Secondly, if you have more text in the callout, then it stops being a callout. I have asked an LLM to lengthen this passage.
27+
Naturally, callouts should `contain` less text within them than the text it lives next to. We do this for several reasons. Firstly, it looks `weird` to have a big empty space in the primary content area. Secondly, if you have more text in the callout, then it stops being a callout. I have asked an LLM to lengthen this passage.
2728

2829
{{<call-out "side-callout">}}
2930
This is a plain side callout with no title. It has a [link](#plain-callouts) to a heading on this page. Its shortcode is `<call-out>` with the `.side-callout` class.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
22
description: Lists
33
title: Lists
4+
weight: 200
45
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Prose
3+
title: Prose
4+
weight: 400
5+
---
6+
7+
This is meant to be an overview of the different kinds of prose-heavy content we expect to find in our docs.

0 commit comments

Comments
 (0)