Skip to content

Instantly share code, notes, and snippets.

@jsonberry
Created July 5, 2016 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsonberry/4c6f5998a54cc4685b798f15de103783 to your computer and use it in GitHub Desktop.
Save jsonberry/4c6f5998a54cc4685b798f15de103783 to your computer and use it in GitHub Desktop.
Modal with scrollable content
.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