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