Skip to content

Commit

Permalink
Simplify styling: combine cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Aug 17, 2023
1 parent 5ca1bb2 commit cff5757
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions assets/scss/_sidebar-tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cff5757

Please sign in to comment.