Skip to content

Commit a3b7e92

Browse files
authored
Merge pull request #274 from dhvcc/sidebar-scrollable
Scroll for fixed sidebar
2 parents 9383099 + d837289 commit a3b7e92

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

jazzmin/static/jazzmin/css/main.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,3 +829,28 @@ body.jazzmin-login-page {
829829
.callout {
830830
color: black;
831831
}
832+
833+
/* sidebar scrolling */
834+
.layout-fixed #jazzy-sidebar {
835+
top: 0;
836+
bottom: 0;
837+
/* Enable y scroll */
838+
overflow-y: scroll;
839+
/* May inherit scroll, so we need to explicitly hide */
840+
overflow-x: hidden;
841+
}
842+
/* calculate height to fit content, we don't to enable scrolling if the content fits */
843+
.layout-fixed #jazzy-sidebar .sidebar {
844+
height: auto !important;
845+
}
846+
/* Hide scrollbar */
847+
.layout-fixed #jazzy-sidebar {
848+
scrollbar-width: none;
849+
}
850+
.layout-fixed #jazzy-sidebar::-webkit-scrollbar {
851+
width: 0;
852+
}
853+
/* nav-item will overflow container in width if scrollbar is visible */
854+
#jazzy-sidebar .nav-sidebar > .nav-item {
855+
width: 100%;
856+
}

0 commit comments

Comments
 (0)