diff --git a/build/scss/_main-sidebar.scss b/build/scss/_main-sidebar.scss index fff1609ad..d497eb541 100644 --- a/build/scss/_main-sidebar.scss +++ b/build/scss/_main-sidebar.scss @@ -1029,3 +1029,68 @@ @include border-bottom-radius(0); } } + +// Custom Area +.sidebar-custom { + [class*="sidebar-dark"] & { + border-top: 1px solid lighten($dark, 12%); + } + + [class*="sidebar-light"] & { + border-top: 1px solid $gray-300; + } +} + +.layout-fixed { + &.sidebar-collapse { + .hide-on-collapse { + display: none; + } + } + + &.sidebar-collapse:hover { + .hide-on-collapse { + display: block; + } + } + + .main-sidebar-custom { + .sidebar { + height: calc(100% - ((#{$main-header-height-inner} + #{$sidebar-custom-height}) + #{$main-header-bottom-border-width})); + } + + .sidebar-custom { + height: $sidebar-custom-height; + padding: $sidebar-custom-padding-x $sidebar-custom-padding-y; + } + } + + .main-sidebar-custom-lg { + .sidebar { + height: calc(100% - ((#{$main-header-height-inner} + #{$sidebar-custom-height-lg}) + #{$main-header-bottom-border-width})); + } + + .sidebar-custom { + height: $sidebar-custom-height-lg; + } + } + + .main-sidebar-custom-xl { + .sidebar { + height: calc(100% - ((#{$main-header-height-inner} + #{$sidebar-custom-height-xl}) + #{$main-header-bottom-border-width})); + } + + .sidebar-custom { + height: $sidebar-custom-height-xl; + } + } + + .main-sidebar-custom, + .main-sidebar-custom-lg, + .main-sidebar-custom-xl { + .pos-right { + position: absolute; + right: .5rem; + } + } +} diff --git a/build/scss/_variables.scss b/build/scss/_variables.scss index 1bdbc0b7f..2482b0cf1 100644 --- a/build/scss/_variables.scss +++ b/build/scss/_variables.scss @@ -38,6 +38,11 @@ $font-size-root: 1rem !default; $sidebar-width: 250px !default; $sidebar-padding-x: .5rem !default; $sidebar-padding-y: 0 !default; +$sidebar-custom-height: 4rem !default; +$sidebar-custom-height-lg: 6rem !default; +$sidebar-custom-height-xl: 8rem !default; +$sidebar-custom-padding-x: .85rem !default; +$sidebar-custom-padding-y: .5rem !default; // Boxed layout maximum width $boxed-layout-max-width: 1250px !default; diff --git a/docs/components/main-sidebar.md b/docs/components/main-sidebar.md index 1f8e5b470..09853d14a 100644 --- a/docs/components/main-sidebar.md +++ b/docs/components/main-sidebar.md @@ -107,6 +107,25 @@ You can add this code above user-panel or nav-sidebar: ``` {: .max-height-300} + +#### Sidebar Custom Area + +You can add a Custom Area inside the Sidebar to display extra buttons or text below your menu entries. + +You can simply add this code after the `div.sidebar`: + +```html + +``` + +> ##### Warning! +> The Sidebar Custom Area works only with `.layout-fixed` enabled. +{: .quote-warning} + + #### Additional Classes ##### Sidebar diff --git a/index.html b/index.html index baee47fe1..949f37b7e 100644 --- a/index.html +++ b/index.html @@ -266,6 +266,12 @@

Fixed Sidebar

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +