2016-01-16 01:25:00 +03:00
// Implementation specification in https://github.com/FezVrasta/bootstrap-material-design/issues/822
2016-01-14 21:08:28 +03:00
// Drawer.
. mdb-layout-drawer {
position : absolute ;
2016-01-15 02:05:16 +03:00
z-index : 5 ; // over a header and content
2016-01-14 21:08:28 +03:00
box-sizing : border-box ;
display : flex ;
max-height : 100 % ;
flex-direction : column ;
flex-wrap : nowrap ;
overflow : visible ;
overflow-y : auto ;
2016-01-14 21:50:27 +03:00
color : $mdb-layout-drawer-text-color ;
2016-01-14 21:08:28 +03:00
background : $mdb-layout-drawer-bg-color ;
// Transform offscreen.
transition : transform ;
will-change : transform ;
transform-style : preserve-3d ;
@include shadow-2dp () ;
@include material-animation-default () ;
> * {
flex-shrink : 0 ;
}
2016-01-18 22:51:46 +03:00
. mdb-nav {
2016-01-14 21:08:28 +03:00
flex-direction : column ;
align-items : stretch ;
padding-top : 1 rem ;
}
}
2016-01-15 02:05:16 +03:00
//----------------
// Sizing and positioning below here
2016-01-14 21:08:28 +03:00
2016-01-15 02:50:09 +03:00
// for left or right drawers, setup widths, heights and positions
2016-01-16 02:58:16 +03:00
@include mdb-drawer-x-closed ( $mdb-layout-drawer-x-size ) ;
2016-01-15 02:05:16 +03:00
2016-01-15 02:50:09 +03:00
// for top or bottom drawers, setup widths, heights and positions
2016-01-16 02:58:16 +03:00
@include mdb-drawer-y-closed ( $mdb-layout-drawer-y-size ) ;
2016-01-15 02:23:03 +03:00
2016-01-19 23:17:08 +03:00
// Marker class for both triggering the opening of the drawer (i.e. javascript #addClass('.mdb-drawer-in')), as well
// as responsive sizes (i.e. mdb-drawer-in-md will open once the browser is wider than 768px).
2016-01-15 02:05:16 +03:00
//
2016-01-16 01:25:00 +03:00
//
2016-01-19 23:17:08 +03:00
// mdb-drawer-in, mdb-drawer-in-sm, mdb-drawer-in-md, mdb-drawer-in-lg
// We iterate over the standard grid breakpoints, but we also need styles for the simpler `mdb-drawer-in`
// without a size (for triggered openings). Since the xs size is 0, instead of using `mdb-drawer-in-xs`
// (which is mostly meaningless), we create `mdb-drawer-in` meaning always open.
2016-01-16 01:25:00 +03:00
//
2016-01-19 23:17:08 +03:00
// NOTE: mdb-drawer-in-* uses media-breakpoint-up()
2016-01-16 01:25:00 +03:00
//
2016-01-15 22:53:30 +03:00
//
2016-01-19 23:17:08 +03:00
// mdb-drawer-out
2016-01-16 01:25:00 +03:00
// A marker class that will _force_ the drawer closed regardless of the responsive class present. If (for some
2016-01-19 23:17:08 +03:00
// strange reason) both mdb-drawer-out and mdb-drawer-in are present, it appears that the closed option wins.
2016-01-16 01:25:00 +03:00
//
//
// mdb-drawer-overlay, mdb-drawer-overlay-sm, mdb-drawer-overlay-md, mdb-drawer-overlay-lg
// We iterate over the standard grid breakpoints, but we also need styles for the simpler `mdb-drawer-overlay`.
// Since the xs size is 0, instead of using `mdb-drawer-overlay-xs`, we create `mdb-drawer-overlay` meaning always overlay.
2016-01-15 22:53:30 +03:00
//
2016-01-16 01:25:00 +03:00
// NOTE: mdb-drawer-overlay-* uses media-breakpoint-down() - this is because we usually want a responsive overlay to be used in small screen scenarios.
//
//
// Drawer open positioning, and style options (push is default, overlay is optional)
// - first eliminate positioning or sizing rules if the drawer is already forced closed (which is the default behavior above)
2016-01-19 23:17:08 +03:00
: not ( . mdb-drawer-out ) {
2016-01-16 01:25:00 +03:00
2016-01-15 02:05:16 +03:00
@each $breakpoint in map-keys ( $grid-breakpoints ) {
2016-01-16 02:58:16 +03:00
@include mdb-drawer-x-open-up ( $mdb-layout-drawer-x-size , $breakpoint ) ;
@include mdb-drawer-y-open-up ( $mdb-layout-drawer-y-size , $breakpoint ) ;
2016-01-15 23:56:11 +03:00
2016-01-18 21:53:44 +03:00
@include mdb-drawer-x-overlay-down ( $breakpoint ) ;
@include mdb-drawer-y-overlay-down ( $breakpoint ) ;
2016-01-14 21:08:28 +03:00
}
}
2016-01-16 02:58:16 +03:00
2016-01-18 21:53:44 +03:00
////----
2016-01-19 23:17:08 +03:00
//// Example 1: creates a media responsive kitchen-sink-drawer that pairs with mdb-drawer-in-lg and allows for triggers mdb-drawer-in && mdb-drawer-out
2016-01-18 21:53:44 +03:00
////
2016-01-19 23:17:08 +03:00
//// Used with <div class="mdb-layout-container mdb-drawer-fixed-left mdb-drawer-overlay-md-down mdb-drawer-in-lg-up kitchen-sink-drawer">
2016-01-18 21:53:44 +03:00
////
2016-01-19 23:17:08 +03:00
//.kitchen-sink-drawer:not(.mdb-drawer-out) {
2016-01-18 21:53:44 +03:00
// @each $breakpoint in (xs lg) {
2016-01-19 23:17:08 +03:00
// // xs gives us the static marker class i.e. mdb-drawer-in && mdb-drawer-out, while lg gives us a responsive open/overlay
2016-01-18 21:53:44 +03:00
// @include mdb-drawer-x-closed(500px);
// @include mdb-drawer-x-open-up(500px, $breakpoint);
// }
2016-01-19 23:17:08 +03:00
// // Create a responsive overlay at mdb-drawer-overlay-md-down - this specificity is required
2016-01-18 21:53:44 +03:00
// @include mdb-drawer-x-overlay-down(md);
//}
//
////----
2016-01-19 23:17:08 +03:00
//// Example 2: creates a NON-responsive kitchen-sink-drawer and allows for triggers mdb-drawer-in && mdb-drawer-out
2016-01-18 21:53:44 +03:00
////
2016-01-19 23:17:08 +03:00
//// Used with <div class="mdb-layout-container mdb-drawer-fixed-left mdb-drawer-in kitchen-sink-drawer-triggered">
2016-01-18 21:53:44 +03:00
////
2016-01-19 23:17:08 +03:00
//.kitchen-sink-drawer-triggered:not(.mdb-drawer-out) {
// @include mdb-drawer-x-closed(500px); // closed by default, also can be triggered with mdb-drawer-out
// @include mdb-drawer-x-open(500px); // triggered with mdb-drawer-in
2016-01-18 21:53:44 +03:00
// @include mdb-drawer-x-overlay(); // overlay by default, no other classes necessary
2016-01-16 02:58:16 +03:00
//}