Implemented an example modal

This commit is contained in:
2018-07-06 07:45:40 +10:00
parent 3ea978e0b6
commit 0ded1b20ad
9 changed files with 298 additions and 12 deletions

View File

@ -68,6 +68,7 @@
@import './objects/_form.scss';
@import './objects/_input.scss';
@import './objects/_loader.scss';
@import './objects/_modal.scss';
@import './objects/_page-transition.scss';
@import './objects/_title.scss';
@import './objects/_video.scss';

View File

@ -0,0 +1,83 @@
/*
* Modal
* Popup box designed to alert, or offer a unique interaction method.
*
* Dependencies:
* styles/tools/_absolute-centering.scss
* styles/tools/_shadow.scss
* styles/settings/z.scss
*
* Version:
* 1.0.0 - 2018/07/05
*/
$o-modal--backdrop: rgba(0, 0, 0, 0.7);
$o-modal--background: white;
$o-modal--padding: 0.5em;
.o-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: $s-z--modal;
&__inner {
position: relative;
width: 100%;
height: 100%;
}
&__backdrop {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: $o-modal--backdrop;
}
&__box {
@include t-absolute-center-x-y();
@extend %t-dp--shadow;
@extend %t-flexbox;
@include t-flex-wrap(wrap);
@include t-flex-direction(column);
@include t-align-items(flex-start);
@include t-align-content(flex-start);
background: $o-modal--background;
width: 100%;
height: 100%;
max-width: 95%;
max-height: 95%;
&-body {
width: 100%;
@include t-flex-grow(1);
position: relative;
/* Unfortunately flex can only get us half way there */
&-inner {//Hacks our content so it will never overflow its container.
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow-y: auto;
padding: $o-modal--padding;
}
}
&-footer {
width: 100%;
padding: $o-modal--padding;
}
}
@include t-media-query($s-xsmall-up) {
&__box {
width: 800px;
height: 600px;
}
}
}

View File

@ -10,4 +10,5 @@ $s-z--background: -1; //Background Element
$s-z--navbar: 10; //Navbar
$s-z--menu: 15; //Hamburger Menu
$s-z--menu-button: 16; //Button to toggle menu.
$s-z--modal: 100; //Modals
$s-z--transition: 1; //The Z-Index of an element in transition