mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-30 05:24:09 +03:00
separated drawer from general layout classes
This commit is contained in:
parent
d3fbacf4fd
commit
1d91b1cbe2
|
@ -3,60 +3,7 @@
|
||||||
|
|
||||||
//WARNING: VERY MUCH A WORK IN PROGRESS!!!!!!!!!!!!!!!!!!!!
|
//WARNING: VERY MUCH A WORK IN PROGRESS!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
.mdb-layout-container {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
// Main layout class.
|
|
||||||
.mdb-layout {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
flex-direction: column; // allows for sticky header and footer
|
|
||||||
overflow-x: hidden;
|
|
||||||
overflow-y: auto;
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Header
|
|
||||||
.mdb-layout-header { // navbar
|
|
||||||
// FIXME: it would be nice to stick this directly on the navbar, but navbars are not flex ready, so this is relegated to be a container at this time.
|
|
||||||
z-index: 3;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
max-height: 1000px;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
flex-shrink: 0;
|
|
||||||
justify-content: flex-start;
|
|
||||||
transition-property: max-height;
|
|
||||||
|
|
||||||
> .navbar { // heights for common scenarios such as a header with a navbar
|
|
||||||
|
|
||||||
// Current navbar is not flex enabled https://github.com/twbs/bootstrap/issues/18875
|
|
||||||
// - with flex a vertical align is a breeze
|
|
||||||
// - with standard layout, we need to use padding instead of height to layout.
|
|
||||||
min-height: $mdb-layout-mobile-header-height;
|
|
||||||
|
|
||||||
// FIXME: hack remove padding once the flex layout works properly
|
|
||||||
$padding: ($mdb-layout-mobile-header-height - (1rem * $line-height)) / 2;
|
|
||||||
padding-top: $padding;
|
|
||||||
padding-bottom: $padding;
|
|
||||||
|
|
||||||
@include media-breakpoint-up(lg) {
|
|
||||||
min-height: $mdb-layout-desktop-header-height;
|
|
||||||
|
|
||||||
// FIXME: hack remove padding once the flex layout works properly
|
|
||||||
$padding: ($mdb-layout-desktop-header-height - (1rem * $line-height)) / 2;
|
|
||||||
padding-top: $padding;
|
|
||||||
padding-bottom: $padding;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Drawer.
|
// Drawer.
|
||||||
.mdb-layout-drawer {
|
.mdb-layout-drawer {
|
||||||
|
@ -73,7 +20,7 @@
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
color: $mdb-layout-text-color;
|
color: $mdb-layout-drawer-text-color;
|
||||||
background: $mdb-layout-drawer-bg-color;
|
background: $mdb-layout-drawer-bg-color;
|
||||||
|
|
||||||
// Transform offscreen.
|
// Transform offscreen.
|
||||||
|
@ -95,18 +42,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content.
|
|
||||||
.mdb-layout-content {
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
display: inline-block;
|
|
||||||
//-ms-flex: 0 1 auto; // Fix IE10 bug.
|
|
||||||
overflow-x: hidden;
|
|
||||||
overflow-y: auto;
|
|
||||||
flex-grow: 1;
|
|
||||||
-webkit-overflow-scrolling: touch; // TODO: why?
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// FIXME: the below needs to happen if it is the right size OR if the drawer is visible. Need to look at collapse or collapseInline to see if it can help us here.
|
// FIXME: the below needs to happen if it is the right size OR if the drawer is visible. Need to look at collapse or collapseInline to see if it can help us here.
|
||||||
|
|
||||||
|
@ -141,7 +76,6 @@
|
||||||
|
|
||||||
// Responsive Content with fixed drawer
|
// Responsive Content with fixed drawer
|
||||||
.mdb-layout-content {
|
.mdb-layout-content {
|
||||||
|
|
||||||
.mdb-layout-fixed-drawer > & {
|
.mdb-layout-fixed-drawer > & {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
70
scss/_layout.scss
Normal file
70
scss/_layout.scss
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
// this is a set of flex-based layout containers necessary for components such as the drawer.
|
||||||
|
|
||||||
|
//WARNING: VERY MUCH A WORK IN PROGRESS!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
.mdb-layout-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
// Main layout class.
|
||||||
|
.mdb-layout {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
flex-direction: column; // allows for sticky header and footer
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Header
|
||||||
|
.mdb-layout-header { // navbar
|
||||||
|
// FIXME: it would be nice to stick this directly on the navbar, but navbars are not flex ready, so this is relegated to be a container at this time.
|
||||||
|
z-index: 3;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
max-height: 1000px;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
flex-shrink: 0;
|
||||||
|
justify-content: flex-start;
|
||||||
|
transition-property: max-height;
|
||||||
|
|
||||||
|
> .navbar { // heights for common scenarios such as a header with a navbar
|
||||||
|
|
||||||
|
// Current navbar is not flex enabled https://github.com/twbs/bootstrap/issues/18875
|
||||||
|
// - with flex a vertical align is a breeze
|
||||||
|
// - with standard layout, we need to use padding instead of height to layout.
|
||||||
|
min-height: $mdb-layout-mobile-header-height;
|
||||||
|
|
||||||
|
// FIXME: hack remove padding once the flex layout works properly
|
||||||
|
$padding: ($mdb-layout-mobile-header-height - (1rem * $line-height)) / 2;
|
||||||
|
padding-top: $padding;
|
||||||
|
padding-bottom: $padding;
|
||||||
|
|
||||||
|
@include media-breakpoint-up(lg) {
|
||||||
|
min-height: $mdb-layout-desktop-header-height;
|
||||||
|
|
||||||
|
// FIXME: hack remove padding once the flex layout works properly
|
||||||
|
$padding: ($mdb-layout-desktop-header-height - (1rem * $line-height)) / 2;
|
||||||
|
padding-top: $padding;
|
||||||
|
padding-bottom: $padding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Content.
|
||||||
|
.mdb-layout-content {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
display: inline-block;
|
||||||
|
//-ms-flex: 0 1 auto; // Fix IE10 bug.
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
flex-grow: 1;
|
||||||
|
-webkit-overflow-scrolling: touch; // TODO: why?
|
||||||
|
}
|
|
@ -38,6 +38,7 @@ $enable-flex: true;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@import "variables/layout";
|
||||||
@import "variables/menu";
|
@import "variables/menu";
|
||||||
@import "variables/drawer";
|
@import "variables/drawer";
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
// Drawer
|
// Drawer
|
||||||
$mdb-layout-drawer-bg-color: rgba($grey-50, 1) !default;
|
$mdb-layout-drawer-bg-color: rgba($grey-50, 1) !default;
|
||||||
$mdb-layout-text-color: rgba($grey-800, 1) !default;
|
$mdb-layout-drawer-text-color: rgba($grey-800, 1) !default;
|
||||||
|
|
||||||
// Sizing
|
// Sizing
|
||||||
$mdb-layout-drawer-sm: 240px !default;
|
$mdb-layout-drawer-sm: 240px !default;
|
||||||
|
|
||||||
// General layout header height.
|
|
||||||
// FIXME: is this really necessary or something to be considered custom?
|
|
||||||
$mdb-layout-mobile-header-height: 3.5rem !default; // 56px
|
|
||||||
$mdb-layout-desktop-header-height: 4rem !default; // 64px
|
|
||||||
|
|
4
scss/variables/_layout.scss
Normal file
4
scss/variables/_layout.scss
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
// General layout header height.
|
||||||
|
// FIXME: is this really necessary or something to be considered custom?
|
||||||
|
$mdb-layout-mobile-header-height: 3.5rem !default; // 56px
|
||||||
|
$mdb-layout-desktop-header-height: 4rem !default; // 64px
|
Loading…
Reference in New Issue
Block a user