Skip to content

Instantly share code, notes, and snippets.

@dsternlicht
Last active November 27, 2018 15:03
Show Gist options
  • Select an option

  • Save dsternlicht/7ff24d4cd2f1f115607ad0d975a784a3 to your computer and use it in GitHub Desktop.

Select an option

Save dsternlicht/7ff24d4cd2f1f115607ad0d975a784a3 to your computer and use it in GitHub Desktop.
CSS Mock for our modal component
.modal {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 990;
}
.modal .overlay {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 995;
background: rgba(0,0,0,0.85);
}
.modal .modal_content {
z-index: 999;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-height: 90%;
overflow: auto;
background: #fff;
box-sizing: border-box;
padding: 20px;
box-shadow: 0 1px 5px rgba(0,0,0,0.7);
border-radius: 4px;
width: 520px; /* This just a default width */
}
.modal .modal_content > h2 {
font-size: 28px;
font-weight: 200;
margin: 20px 0 40px;
text-align: center;
}
.modal .modal_content .buttons_wrapper {
padding: 20px;
}
.modal .close_modal {
position: absolute;
right: 10px;
top: 10px;
cursor: pointer;
font-size: 18px;
opacity: 0.5;
background: none;
border: none;
transition: opacity 0.2s ease;
}
.modal .close_modal:hover {
opacity: 0.9;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment