From cff57575c3f6c1042cb4894e3db87940844297e5 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Fri, 11 Aug 2023 06:52:09 -0400 Subject: [PATCH] Simplify styling: combine cases --- assets/scss/_sidebar-tree.scss | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/assets/scss/_sidebar-tree.scss b/assets/scss/_sidebar-tree.scss index d1623c0168..50beb4e119 100644 --- a/assets/scss/_sidebar-tree.scss +++ b/assets/scss/_sidebar-tree.scss @@ -15,26 +15,21 @@ } } - // Adjust height and padding when sidebar_search_disable is true + // Adjust height and padding when sidebar_search_disable is true, but only for + // >= `lg` views, because on tablet (`md`) and mobile (<= `sm`), the search + // box is displayed regardless of the value of sidebar_search_disable: &.td-sidebar-nav--search-disabled { - padding-top: 1rem; + @include media-breakpoint-up(lg) { + // There's no search box so add top padding + // and adjust max-height: + padding-top: 1rem; - @include media-breakpoint-up(md) { @supports (position: sticky) { max-height: calc(#{$_max-height} + 4.5rem); } } } - // Handle cases for tablet (`md`) and mobile (<= `sm`) where the search box is - // displayed regardless of the value of sidebar_search_disable: - @include media-breakpoint-down(lg) { - padding-top: 0 !important; - @supports (position: sticky) { - max-height: $_max-height !important; - } - } - @include media-breakpoint-up(md) { display: block !important; }