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-22 04:03:29 +03:00
font-size : .875 rem ;
2016-01-23 00:05:43 +03:00
//color: $mdb-layout-drawer-text-color;
//background: $mdb-layout-drawer-bg-color;
2016-01-14 21:08:28 +03:00
// Transform offscreen.
transition : transform ;
will-change : transform ;
transform-style : preserve-3d ;
2016-01-20 21:55:32 +03:00
@include box-shadow ( $mdb-shadow-2dp ) ;
2016-01-14 21:08:28 +03:00
@include material-animation-default () ;
> * {
flex-shrink : 0 ;
}
2016-01-22 04:03:29 +03:00
// Placement of common components within the drawer
// You might say this is opinionated - feedback welcome.
> header {
display : flex ;
flex-direction : column ;
justify-content : flex-end ;
padding : 1 rem ;
. navbar-brand {
padding-left : 1 .5 rem ;
font-size : 1 .25 rem ;
}
}
> . list-group {
2016-01-14 21:08:28 +03:00
padding-top : 1 rem ;
2016-01-22 04:03:29 +03:00
. list-group-item {
padding-right : 2 .5 rem ;
padding-left : 2 .5 rem ;
font-size : .8125 rem ;
font-weight : 500 ;
}
2016-01-14 21:08:28 +03:00
}
}
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-23 00:05:43 +03:00
@include mdb-drawer-x-out ( $mdb-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-23 00:05:43 +03:00
@include mdb-drawer-y-out ( $mdb-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-21 02:10:34 +03:00
// mdb-drawer-out
// A marker class that will _force_ the drawer closed regardless of the responsive class present. If (for some
// strange reason) both mdb-drawer-out and mdb-drawer-in are present, it appears that the closed option wins.
2016-01-15 22:53:30 +03:00
//
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)
2016-01-21 02:10:34 +03:00
: not ( . mdb-drawer-out ) { // first eliminate positioning or sizing rules if the drawer is already forced closed
@each $breakpoint in map-keys ( $grid-breakpoints ) {
2016-01-16 01:25:00 +03:00
2016-01-23 00:05:43 +03:00
@include mdb-drawer-x-in-up ( $mdb-drawer-x-size , $breakpoint ) ;
@include mdb-drawer-y-in-up ( $mdb-drawer-y-size , $breakpoint ) ;
2016-01-15 02:05:16 +03:00
2016-01-21 02:10:34 +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-23 00:05:43 +03:00
////----
//// Example 1: creates a media responsive kitchen-sink-drawer that pairs with mdb-drawer-in-lg and allows for the mdb-drawer-in trigger
2016-01-21 23:29:25 +03:00
//.kitchen-sink-drawer {
2016-01-23 00:05:43 +03:00
// $custom-size: 500px;
// @include mdb-drawer-x-out($custom-size);
2016-01-21 23:29:25 +03:00
// &:not(.mdb-drawer-out) {
2016-01-23 00:05:43 +03:00
// @each $breakpoint in map-keys($grid-breakpoints) {
// @include mdb-drawer-x-in-up($custom-size, $breakpoint);
2016-01-21 23:29:25 +03:00
// }
// }
//}
2016-01-20 00:41:30 +03:00
//
2016-01-23 00:05:43 +03:00
////
////----
//// Example 2: creates a NON-responsive kitchen-sink-drawer and allows for the mdb-drawer-in trigger
//.kitchen-sink-drawer-static {
// $custom-size: 500px;
// @include mdb-drawer-x-out($custom-size); // closed by default
// @include mdb-drawer-x-in($custom-size); // triggered with mdb-drawer-in
2016-01-21 23:29:25 +03:00
// @include mdb-drawer-x-overlay(); // overlay by default, no other classes necessary
//}
2016-01-16 02:58:16 +03:00