Created
July 5, 2016 18:14
-
-
Save jsonberry/4c6f5998a54cc4685b798f15de103783 to your computer and use it in GitHub Desktop.
Modal with scrollable content
This file contains 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 { | |
min-height: 100%; | |
position: fixed; | |
background-color: $darkslategray-opaque; | |
transform: translateY(-150%); | |
transition: transform 750ms ease-in-out; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} | |
.modal__content { | |
width: 90%; | |
background-color: white; | |
border-radius: 2px; | |
// Right here is what enables the dialog to be scrollable | |
max-height: calc(100vh - 210px); | |
overflow-y: auto; | |
} | |
.modal--active { | |
transform: translateX(0); | |
} | |
// jQuery | |
// $('.modal--open').on('click', function(e) { | |
// $('#modal').addClass('modal--active'); | |
// }); | |
// $('.modal--close').on('click', function(e) { | |
// $('#modal').removeClass('modal--active'); | |
// }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment