From b48419b23bcede77c3ba208fce0899e03f4c32ee Mon Sep 17 00:00:00 2001 From: REJack Date: Wed, 22 Jul 2020 16:06:12 +0200 Subject: [PATCH] sidebar custom area (#2908) * add sidebar-custom style * fix hide-on-collapse * add new sidebar menu entry * add custom area docs info --- build/scss/_main-sidebar.scss | 65 ++ build/scss/_variables.scss | 5 + docs/components/main-sidebar.md | 19 + index.html | 6 + index2.html | 6 + index3.html | 6 + pages/UI/buttons.html | 6 + pages/UI/general.html | 6 + pages/UI/icons.html | 6 + pages/UI/modals.html | 6 + pages/UI/navbar.html | 6 + pages/UI/ribbons.html | 6 + pages/UI/sliders.html | 6 + pages/UI/timeline.html | 6 + pages/calendar.html | 6 + pages/charts/chartjs.html | 6 + pages/charts/flot.html | 6 + pages/charts/inline.html | 6 + pages/examples/404.html | 6 + pages/examples/500.html | 6 + pages/examples/blank.html | 6 + pages/examples/contacts.html | 6 + pages/examples/e-commerce.html | 6 + pages/examples/invoice.html | 6 + pages/examples/language-menu.html | 6 + pages/examples/legacy-user-menu.html | 6 + pages/examples/pace.html | 6 + pages/examples/profile.html | 6 + pages/examples/project-add.html | 6 + pages/examples/project-detail.html | 6 + pages/examples/project-edit.html | 6 + pages/examples/projects.html | 6 + pages/forms/advanced.html | 6 + pages/forms/editors.html | 6 + pages/forms/general.html | 6 + pages/forms/validation.html | 6 + pages/gallery.html | 6 + pages/layout/boxed.html | 6 + pages/layout/collapsed-sidebar.html | 6 + pages/layout/fixed-footer.html | 6 + pages/layout/fixed-sidebar-custom.html | 812 +++++++++++++++++++++++++ pages/layout/fixed-sidebar.html | 6 + pages/layout/fixed-topnav.html | 6 + pages/layout/top-nav-sidebar.html | 6 + pages/mailbox/compose.html | 6 + pages/mailbox/mailbox.html | 6 + pages/mailbox/read-mail.html | 6 + pages/tables/data.html | 6 + pages/tables/jsgrid.html | 6 + pages/tables/simple.html | 6 + pages/widgets.html | 6 + 51 files changed, 1183 insertions(+) create mode 100644 pages/layout/fixed-sidebar-custom.html 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

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