Skip to content

Instantly share code, notes, and snippets.

@ChrisLTD
Created June 13, 2019 22:17
Show Gist options
  • Save ChrisLTD/3f16a9a0d6897aa436f00f5bc772a891 to your computer and use it in GitHub Desktop.
Save ChrisLTD/3f16a9a0d6897aa436f00f5bc772a891 to your computer and use it in GitHub Desktop.
Simple Modal CSS
.modal, .modal-bg {
display: none;
}
.modal-active .modal-bg {
display: block;
background-color: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}
.modal-active .modal {
display: block;
position: fixed;
width: 100%;
max-width: 580px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1001;
max-height: 100%;
overflow-y: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment