mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2025-02-02 12:54:13 +03:00
#822 drawer checkpoint with overlay marker classes, before trying to reduce unnecessary code generation.
This commit is contained in:
parent
ae7a1ca279
commit
798a397b4f
|
@ -117,22 +117,26 @@
|
||||||
@each $side in (left right) {
|
@each $side in (left right) {
|
||||||
|
|
||||||
&.mdb-drawer-fixed-#{$side}:not(.mdb-drawer-closed) {
|
&.mdb-drawer-fixed-#{$side}:not(.mdb-drawer-closed) {
|
||||||
// 1. Push - drawer will push the header and content
|
|
||||||
> .mdb-layout-header {
|
// 1. Push - drawer will push the header and content (default behavior)
|
||||||
width: calc(100% - #{$mdb-layout-drawer-size});
|
&,
|
||||||
margin-#{$side}: $mdb-layout-drawer-size;
|
&.mdb-drawer-push {
|
||||||
|
> .mdb-layout-header {
|
||||||
|
width: calc(100% - #{$mdb-layout-drawer-size});
|
||||||
|
margin-#{$side}: $mdb-layout-drawer-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .mdb-layout-drawer {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
> .mdb-layout-content {
|
||||||
|
margin-#{$side}: $mdb-layout-drawer-size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .mdb-layout-drawer {
|
// 2. Overlay - drawer will overlay content/header at the pre-configured breakpoint OR if marked as mdb-drawer-overlay
|
||||||
transform: translateX(0);
|
@include media-breakpoint-down-or($mdb-layout-drawer-x-overlay-breakpoint, "&.mdb-drawer-overlay") {
|
||||||
}
|
|
||||||
|
|
||||||
> .mdb-layout-content {
|
|
||||||
margin-#{$side}: $mdb-layout-drawer-size;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Overlay - drawer will overlay content/header push at the pre-configured breakpoint
|
|
||||||
@include media-breakpoint-down($mdb-layout-drawer-x-overlay-breakpoint) {
|
|
||||||
> .mdb-layout-header,
|
> .mdb-layout-header,
|
||||||
> .mdb-layout-content {
|
> .mdb-layout-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -142,6 +146,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// top bottom
|
||||||
|
#{unquote($name)} { // mdb-drawer-open, mdb-drawer-open-sm, mdb-drawer-open-md, mdb-drawer-open-lg
|
||||||
|
|
||||||
// mdb-drawer-fixed-(top and bottom) styles
|
// mdb-drawer-fixed-(top and bottom) styles
|
||||||
@each $side in (top bottom) {
|
@each $side in (top bottom) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
@import "mixins/utilities";
|
@import "mixins/utilities";
|
||||||
|
@import "mixins/breakpoints";
|
||||||
@import "mixins/animations";
|
@import "mixins/animations";
|
||||||
@import "mixins/type";
|
@import "mixins/type";
|
||||||
@import "mixins/drawer";
|
@import "mixins/drawer";
|
||||||
|
|
34
scss/mixins/_breakpoints.scss
Normal file
34
scss/mixins/_breakpoints.scss
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
// case where behavior is responsive, or with a marker class
|
||||||
|
@mixin media-breakpoint-down-or($breakpoint, $name) {
|
||||||
|
#{unquote($name)} {
|
||||||
|
@content
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-down($breakpoint) {
|
||||||
|
@content
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// case where behavior is responsive, or with a marker class
|
||||||
|
@mixin media-breakpoint-up-or($breakpoint, $name) {
|
||||||
|
#{unquote($name)} {
|
||||||
|
@content
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-up($breakpoint) {
|
||||||
|
@content
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name of the previous breakpoint, or null
|
||||||
|
//
|
||||||
|
// >> breakpoint-next(sm)
|
||||||
|
// xs
|
||||||
|
// >> breakpoint-next(sm, (xs: 0, sm: 544px, md: 768px))
|
||||||
|
// xs
|
||||||
|
// >> breakpoint-next(sm, $breakpoint-names: (xs sm md))
|
||||||
|
// xs
|
||||||
|
@function breakpoint-previous($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
|
||||||
|
$n: index($breakpoint-names, $name);
|
||||||
|
@return if($n > 1, nth($breakpoint-names, $n - 1), null);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user