2016-01-26 21:12:48 +03:00
|
|
|
// Mixins to allow creation of additional custom drawer sizes when using the defaults at the same time
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-x-out($size) {
|
2019-07-04 00:37:32 +03:00
|
|
|
|
|
|
|
@each $side,
|
|
|
|
$abbrev in (left: l, right: r) {
|
|
|
|
#{if(&, "&", "*")}.bmd-drawer-f-#{$abbrev} {
|
|
|
|
>.bmd-layout-drawer {
|
2016-01-26 21:12:48 +03:00
|
|
|
// position
|
|
|
|
top: 0;
|
|
|
|
#{$side}: 0;
|
|
|
|
|
|
|
|
width: $size;
|
|
|
|
height: 100%;
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@if $side==left {
|
|
|
|
transform: translateX(-$size - 10px); // initial position of drawer (closed), way off screen
|
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
transform: translateX($size + 10px); // initial position of drawer (closed), way off screen
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-header,
|
|
|
|
>.bmd-layout-content {
|
2016-01-26 21:12:48 +03:00
|
|
|
margin-#{$side}: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-y-out($size) {
|
2019-07-04 00:37:32 +03:00
|
|
|
|
|
|
|
@each $side,
|
|
|
|
$abbrev in (top: t, bottom: b) {
|
|
|
|
#{if(&, "&", "*")}.bmd-drawer-f-#{$abbrev} {
|
|
|
|
>.bmd-layout-drawer {
|
2016-01-26 21:12:48 +03:00
|
|
|
// position
|
|
|
|
#{$side}: 0;
|
|
|
|
left: 0;
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
height: $size;
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@if $side==top {
|
|
|
|
transform: translateY(-$size - 10px); // initial position of drawer (closed), way off screen
|
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
transform: translateY($size + 10px); // initial position of drawer (closed), way off screen
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-content {
|
2016-01-26 21:12:48 +03:00
|
|
|
margin-#{$side}: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@function bmd-drawer-breakpoint-name($breakpoint, $suffix: "") {
|
2016-01-26 21:12:48 +03:00
|
|
|
// e.g. &, &-sm, &-md, &-lg
|
|
|
|
$name: "&-#{$breakpoint}#{$suffix}";
|
2019-07-04 00:37:32 +03:00
|
|
|
|
|
|
|
@if $breakpoint==xs {
|
2016-01-26 21:12:48 +03:00
|
|
|
$name: "&";
|
|
|
|
}
|
2019-07-04 00:37:32 +03:00
|
|
|
|
2016-01-26 21:12:48 +03:00
|
|
|
@return $name;
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-x-in($size) {
|
2019-07-04 00:37:32 +03:00
|
|
|
|
|
|
|
@each $side,
|
|
|
|
$abbrev in (left: l, right: r) {
|
|
|
|
#{if(&, "&", "*")}.bmd-drawer-f-#{$abbrev} {
|
|
|
|
|
2016-01-26 21:12:48 +03:00
|
|
|
// Push - drawer will push the header and content (default behavior)
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-header {
|
2016-01-26 21:12:48 +03:00
|
|
|
width: calc(100% - #{$size});
|
|
|
|
margin-#{$side}: $size;
|
|
|
|
}
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-drawer {
|
2016-01-26 21:12:48 +03:00
|
|
|
transform: translateX(0);
|
|
|
|
}
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-content {
|
2016-01-26 21:12:48 +03:00
|
|
|
margin-#{$side}: $size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-y-in($size) {
|
2019-07-04 00:37:32 +03:00
|
|
|
|
|
|
|
@each $side,
|
|
|
|
$abbrev in (top: t, bottom: b) {
|
|
|
|
#{if(&, "&", "*")}.bmd-drawer-f-#{$abbrev} {
|
|
|
|
|
2016-01-26 21:12:48 +03:00
|
|
|
// 1. Push - drawer will push the header or content
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-header {
|
|
|
|
@if $side==top {
|
2017-08-11 17:59:31 +03:00
|
|
|
// only add margin-top on a header when the drawer is at the top
|
2016-01-26 21:12:48 +03:00
|
|
|
margin-#{$side}: $size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-drawer {
|
2016-01-26 21:12:48 +03:00
|
|
|
transform: translateY(0);
|
|
|
|
}
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-content {
|
|
|
|
@if $side==bottom {
|
2017-08-11 17:59:31 +03:00
|
|
|
// only add margin-bottom on content when the drawer is at the bottom
|
2016-01-26 21:12:48 +03:00
|
|
|
margin-#{$side}: $size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// breakpoint based open to a particular size
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-x-in-up($size, $breakpoint) {
|
2016-01-26 21:12:48 +03:00
|
|
|
// e.g. &, &-sm, &-md, &-lg
|
2016-03-21 17:56:51 +03:00
|
|
|
$name: bmd-drawer-breakpoint-name($breakpoint, "-up");
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
&.bmd-drawer-in {
|
2017-08-11 17:59:31 +03:00
|
|
|
#{unquote($name)} {
|
|
|
|
// bmd-drawer-in, bmd-drawer-in-sm, bmd-drawer-in-md, bmd-drawer-in-lg
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@if $breakpoint==xs {
|
2016-03-21 17:56:51 +03:00
|
|
|
// bmd-drawer-in marker class (non-responsive)
|
|
|
|
@include bmd-drawer-x-in($size);
|
2019-07-04 00:37:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
|
2016-01-26 21:12:48 +03:00
|
|
|
// responsive class
|
|
|
|
@include media-breakpoint-up($breakpoint) {
|
2016-03-21 17:56:51 +03:00
|
|
|
// bmd-drawer-f-(left and right) styles
|
|
|
|
@include bmd-drawer-x-in($size);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// breakpoint based open to a particular size
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-y-in-up($size, $breakpoint) {
|
2016-01-26 21:12:48 +03:00
|
|
|
// e.g. &, &-sm, &-md, &-lg
|
2016-03-21 17:56:51 +03:00
|
|
|
$name: bmd-drawer-breakpoint-name($breakpoint, "-up");
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
&.bmd-drawer-in {
|
2017-08-11 17:59:31 +03:00
|
|
|
#{unquote($name)} {
|
|
|
|
// bmd-drawer-in, bmd-drawer-in-sm, bmd-drawer-in-md, bmd-drawer-in-lg
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@if $breakpoint==xs {
|
2016-03-21 17:56:51 +03:00
|
|
|
// bmd-drawer-in marker class (non-responsive)
|
|
|
|
@include bmd-drawer-y-in($size);
|
2019-07-04 00:37:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
|
2016-01-26 21:12:48 +03:00
|
|
|
// responsive class
|
|
|
|
@include media-breakpoint-up($breakpoint) {
|
2016-03-21 17:56:51 +03:00
|
|
|
// bmd-drawer-f-(left and right) styles
|
|
|
|
@include bmd-drawer-y-in($size);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-x-overlay() {
|
|
|
|
@include bmd-layout-backdrop-in();
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@each $side,
|
|
|
|
$abbrev in (left: l, right: r) {
|
2016-03-21 17:56:51 +03:00
|
|
|
&.bmd-drawer-f-#{$abbrev} {
|
2019-07-04 00:37:32 +03:00
|
|
|
|
|
|
|
>.bmd-layout-header,
|
|
|
|
>.bmd-layout-content {
|
2016-01-26 21:12:48 +03:00
|
|
|
width: 100%;
|
|
|
|
margin-#{$side}: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-y-overlay() {
|
|
|
|
@include bmd-layout-backdrop-in();
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@each $side,
|
|
|
|
$abbrev in (top: t, bottom: b) {
|
2016-03-21 17:56:51 +03:00
|
|
|
&.bmd-drawer-f-#{$abbrev} {
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-header {
|
|
|
|
@if $side==top {
|
2017-08-11 17:59:31 +03:00
|
|
|
// only add margin-top on a header when the drawer is at the top
|
2016-01-26 21:12:48 +03:00
|
|
|
margin-#{$side}: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
>.bmd-layout-content {
|
|
|
|
@if $side==bottom {
|
2017-08-11 17:59:31 +03:00
|
|
|
// only add margin-bottom on content when the drawer is at the bottom
|
2016-01-26 21:12:48 +03:00
|
|
|
margin-#{$side}: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Overlay - left/right responsive overlay classes and marker class
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-x-overlay-down($breakpoint) {
|
2016-01-26 21:12:48 +03:00
|
|
|
// e.g. &, &-sm, &-md, &-lg
|
2016-03-21 17:56:51 +03:00
|
|
|
$name: bmd-drawer-breakpoint-name($breakpoint, "-down");
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
&.bmd-drawer-overlay {
|
2017-08-11 17:59:31 +03:00
|
|
|
#{unquote($name)} {
|
|
|
|
// bmd-drawer-overlay, bmd-drawer-overlay-sm, bmd-drawer-overlay-md, bmd-drawer-overlay-lg
|
2016-01-26 21:12:48 +03:00
|
|
|
|
|
|
|
// x - left/right
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@if $breakpoint==xs {
|
2017-08-11 17:59:31 +03:00
|
|
|
// overlay marker class (non-responsive)
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
// Must double up on the .bmd-drawer-overlay class to increase specificity otherwise the
|
|
|
|
// responsive bmd-drawer-in-* media queries above win (and overlay is ignored)
|
|
|
|
&.bmd-drawer-overlay {
|
|
|
|
@include bmd-drawer-x-overlay();
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
2019-07-04 00:37:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
2017-08-11 17:59:31 +03:00
|
|
|
@include media-breakpoint-down($breakpoint) {
|
|
|
|
// overlay responsive class
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-drawer-x-overlay();
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Overlay - top/bottom responsive overlay classes and marker class
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-drawer-y-overlay-down($breakpoint) {
|
2016-01-26 21:12:48 +03:00
|
|
|
// e.g. &, &-sm, &-md, &-lg
|
2016-03-21 17:56:51 +03:00
|
|
|
$name: bmd-drawer-breakpoint-name($breakpoint, "-down");
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
&.bmd-drawer-overlay {
|
2017-08-11 17:59:31 +03:00
|
|
|
#{unquote($name)} {
|
|
|
|
// bmd-drawer-overlay, bmd-drawer-overlay-sm, bmd-drawer-overlay-md, bmd-drawer-overlay-lg
|
2016-01-26 21:12:48 +03:00
|
|
|
//// y - top/bottom
|
|
|
|
|
2019-07-04 00:37:32 +03:00
|
|
|
@if $breakpoint==xs {
|
2017-08-11 17:59:31 +03:00
|
|
|
// overlay marker class (non-responsive)
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
// Must double up on the .bmd-drawer-overlay class to increase specificity otherwise the
|
|
|
|
// responsive bmd-drawer-in-* media queries above win (and overlay is ignored)
|
|
|
|
&.bmd-drawer-overlay {
|
|
|
|
@include bmd-drawer-y-overlay();
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
2019-07-04 00:37:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
2017-08-11 17:59:31 +03:00
|
|
|
@include media-breakpoint-down($breakpoint) {
|
|
|
|
// overlay responsive class
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-drawer-y-overlay();
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|