Last active
August 13, 2022 17:49
-
-
Save jgoslow/709f23044fb535c71fed84dbc272d9ec to your computer and use it in GitHub Desktop.
Lyra Modal SCSS Mixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Modal styles - mostly based on Bootstrap | |
@mixin modal() { | |
position: fixed; | |
pointer-events: none; | |
opacity: 0; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
z-index: 1050; | |
-webkit-overflow-scrolling: touch; | |
outline: 0; | |
.close-boot-modal-bg { | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
z-index: 2; | |
background-color: rgba(255,255,255,.7); | |
} | |
.modal-dialog { | |
position: relative; | |
width: auto; | |
margin: 10px; | |
z-index: 3; | |
@media (min-width: 768px) and (max-width: 1080px) { | |
width: 600px; | |
margin: 30px auto; | |
} | |
@media (min-width: 1081px) { | |
width: 967px; | |
margin: 53px auto; | |
} | |
} | |
.modal-content { | |
position: relative; | |
background-color: #fff; | |
border: 1px solid #47505f; | |
border: 1px solid rgba(71,80,95,.2); | |
-webkit-box-shadow: 0 3px 9px rgba(71,80,95,.5); | |
box-shadow: 0 3px 9px rgba(71,80,95,.5); | |
background-clip: padding-box; | |
outline: 0; | |
@media (min-width: 375px) { | |
-webkit-box-shadow: 0 5px 15px rgba(71,80,95,.5); | |
box-shadow: 0 5px 15px rgba(71,80,95,.5); | |
} | |
} | |
.modal-header { | |
padding: 65px 35px 15px; | |
min-height: 16.42857143px; | |
.title2 { | |
margin-bottom: 0; | |
} | |
.close { | |
float: right; | |
font-size: 21px; | |
font-weight: 700; | |
line-height: 1; | |
opacity: 1; | |
filter: alpha(opacity=100); | |
font-size: 15px; | |
color: #555555; | |
position: absolute; | |
right: 40px; | |
top: 20px; | |
margin-top: -2px; | |
text-indent: 0; | |
&:hover { | |
color: #000; | |
text-decoration: none; | |
cursor: pointer; | |
opacity: .5; | |
} | |
&:before { | |
content: ''; | |
height: 20px; | |
width: 20px; | |
background: url(https://marketing.modcloth.com/cms/referral-program/modal/img/x.png) center no-repeat; | |
background-size: 100%; | |
position: absolute; | |
right: -24px; | |
top: 0; | |
-ms-transform: rotate(180deg); | |
-webkit-transform: rotate(180deg); | |
transform: rotate(180deg); | |
@media (min-width: 375px) { | |
height: 25px; | |
width: 25px; | |
} | |
} | |
} | |
.modal-title { | |
margin: 0; | |
line-height: 1.42857143; | |
font-size: 31px; | |
} | |
} | |
.modal-body { | |
padding: 0 25px 35px; | |
@media (min-width: 1081px) { | |
padding: 0 45px 65px 80px; | |
} | |
} | |
.modal-footer { | |
text-align: center; | |
padding: 0 0 25px; | |
.close-text { | |
font-weight: 600; | |
font-size: 17px; | |
text-transform: uppercase; | |
color: #555; | |
} | |
} | |
&.fade .modal-dialog { | |
-webkit-transform: translate(0,-25%); | |
-ms-transform: translate(0,-25%); | |
transform: translate(0,-25%); | |
-webkit-transition: -webkit-transform .3s ease-out; | |
-moz-transition: -moz-transform .3s ease-out; | |
-o-transition: -o-transform .3s ease-out; | |
transition: transform .3s ease-out; | |
} | |
&.in .modal-dialog { | |
-webkit-transform: translate(0,0); | |
-ms-transform: translate(0,0); | |
transform: translate(0,0); | |
} | |
&.fade.in { | |
opacity: 1; | |
pointer-events: all; | |
overflow: auto; | |
overflow-y: scroll; | |
} | |
.fade { | |
opacity: 0; | |
-webkit-transition: opacity .15s linear; | |
transition: opacity .15s linear; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment