From 249a4c2ed5ef0d808584d1808e32e61cae3f3709 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Fri, 11 Aug 2023 05:59:47 -0400 Subject: [PATCH 1/3] Fix left-nav height and padding (no vars) --- assets/scss/_sidebar-tree.scss | 32 ++++++++++++++++++++++++------ layouts/partials/sidebar-tree.html | 5 ++++- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/assets/scss/_sidebar-tree.scss b/assets/scss/_sidebar-tree.scss index a7b92bb4cc..855ab109b7 100644 --- a/assets/scss/_sidebar-tree.scss +++ b/assets/scss/_sidebar-tree.scss @@ -2,17 +2,39 @@ // Left side navigation // .td-sidebar-nav { + $_max-height: calc(100vh - 8.5rem); + padding-right: 0.5rem; margin-right: -15px; margin-left: -15px; @include media-breakpoint-up(md) { @supports (position: sticky) { - max-height: calc(100vh - 10rem); + max-height: $_max-height; overflow-y: auto; } } + // Adjust height and padding when sidebar_search_disable is true + &.td-sidebar-nav--search-disabled { + padding-top: 1rem; + + @include media-breakpoint-up(md) { + @supports (position: sticky) { + max-height: calc(#{$_max-height} + 4.5rem); + } + } + } + + // Handle the case where #content-mobile is displayed with a search box, + // regardless of the value of sidebar_search_disable: + @include media-breakpoint-only(md) { + padding-top: 0 !important; + @supports (position: sticky) { + max-height: $_max-height !important; + } + } + @include media-breakpoint-up(md) { display: block !important; } @@ -22,7 +44,7 @@ list-style: none; } - ul { + &.ul-0, ul { padding: 0; margin: 0; } @@ -119,9 +141,7 @@ } &__search { - padding: 1rem 15px; - margin-right: -15px; - margin-left: -15px; + padding: 1rem 0; } &__inner { @@ -132,7 +152,7 @@ position: sticky; top: 4rem; z-index: 10; - height: calc(100vh - 6rem); + height: calc(100vh - 5rem); } } diff --git a/layouts/partials/sidebar-tree.html b/layouts/partials/sidebar-tree.html index 60f583c111..2ce0c56373 100644 --- a/layouts/partials/sidebar-tree.html +++ b/layouts/partials/sidebar-tree.html @@ -18,7 +18,10 @@
{{ end -}} -