Skip to content

Commit 226c161

Browse files
committed
Styles: Sidebar style refresh
1 parent 78599a2 commit 226c161

File tree

9 files changed

+150
-186
lines changed

9 files changed

+150
-186
lines changed

assets/css/v2/style.css

Lines changed: 44 additions & 175 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,18 @@ 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,
629+
.sidebar li {
630+
margin: 0;
631+
padding: 0;
626632
}
627633

628634
.sidebar .product-selector-button {
@@ -647,9 +653,9 @@ body:not(:has(.main-layout)) header atomic-search-interface {
647653
display: none;
648654
position: absolute;
649655
top: 0;
650-
min-width: 80%;
656+
min-width: 20rem;
651657
margin-top: 8.375rem;
652-
margin-left: 44rem;
658+
margin-left: calc(var(--sidebar-width) + 20rem);
653659
padding: 1rem 1.5rem;
654660
background-color: white;
655661
border: black 1px solid;
@@ -688,40 +694,29 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
688694
.sidebar .scrollbar-container {
689695
width: 100%;
690696
max-height: 100vh;
691-
overflow: scroll;
697+
overflow: auto;
692698
scrollbar-gutter: stable;
693-
scrollbar-width: none;
699+
scrollbar-width: thin;
700+
font-size: 0.875rem;
694701
}
695702

696703
.sidebar .scrollbar-container:hover {
697704
overflow: auto;
698705
}
699706

700-
.sidebar .sidebar-navigation {
701-
margin-left: var(--sidebar-margin);
702-
}
703-
704707
/* removes the built in ul padding/margin */
705708
.sidebar .sidebar-navigation ul {
706709
margin-left: 0;
707710
padding-left: 0;
708711
list-style-type: none;
709712
}
710713

711-
.sidebar ul :not(.sidebar-navigation) ul {
712-
padding-left: 16px;
713-
}
714-
715-
.sidebar .sidebar-navigation li {
716-
margin-bottom: 16px;
717-
}
718-
719714
.sidebar .sidebar-navigation a {
720715
text-decoration: none;
721-
color: black;
722716
}
723717

724718
.sidebar .sidebar-navigation .collapsible-header {
719+
display: block;
725720
cursor: pointer;
726721
}
727722

@@ -752,162 +747,38 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
752747
display: block;
753748
}
754749

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;
750+
ul.collapsible-content {
751+
padding: 0.25rem 0;
799752
}
800753

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-
}
754+
li.parent-collapsible-content-item {
755+
padding: 0.5rem 0 0.4rem 0;
756+
font-weight: 450;
814757

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;
858-
}
859-
860-
.sidebar .sidebar-navigation ul li .partial {
861-
margin-top: 0;
862-
top: 5px;
863-
left: -13px;
758+
a,
759+
label {
760+
color: black;
761+
display: block;
762+
}
864763
}
865764

866-
/* First Sidebar Nav Vertical Line */
867-
.sidebar .sidebar-navigation .parent-collapsible-content {
868-
position: relative;
869-
}
765+
ul.collapsible-content > li > a,
766+
#TableOfContents ul > li > a {
767+
padding: 0.25rem 0.75rem;
768+
margin: 2px 0.5rem 2px 0;
769+
border-radius: 5px;
870770

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-
}
771+
color: oklch(0 0 0 / 0.75);
889772

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);
773+
&.current {
774+
color: oklch(var(--color-brand) / 1);
775+
background-color: oklch(var(--color-brand) / 0.1);
776+
}
902777
}
903778

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%;
779+
ul.collapsible-content .current,
780+
ul.parent-collapsible-content .current {
781+
font-weight: 600;
911782
}
912783

913784
.row {
@@ -917,9 +788,8 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
917788
}
918789

919790
/* Table of Contents */
920-
#TableOfContents {
921-
/* Close all TOC on sidebar */
922-
display: none;
791+
#TableOfContents ul {
792+
padding: 0 0 0.5rem 0.75rem;
923793
}
924794

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

930800
#TableOfContents li:not(:empty) {
931-
position: relative;
932-
list-style: square;
801+
list-style: none;
933802
}
934803

935804
/* MARK: Content
936805
*/
937806
main {
938807
flex: 1;
939808
min-width: 20rem;
940-
margin: 0 2rem 2rem 2rem;
809+
margin: 0 2rem 2rem 0;
941810
}
942811

943812
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)