fradrive/static/css/utils/modal.scss
2019-02-24 22:27:45 +01:00

99 lines
1.6 KiB
SCSS

.modal {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%) scale(0.8, 0.8);
display: block;
background-color: rgba(255, 255, 255, 1);
min-width: 60vw;
min-height: 100px;
max-height: calc(100vh - 30px);
border-radius: 2px;
z-index: -1;
color: var(--color-font);
padding: 0 65px 0 20px;
overflow: auto;
overscroll-behavior: contain;
transition:
opacity .2s .1s ease-in-out,
transform .3s ease-in-out;
pointer-events: none;
opacity: 0;
&.modal--open {
opacity: 1;
pointer-events: auto;
z-index: 200;
transform: translate(-50%, -50%) scale(1, 1);
}
.modal__content {
margin: 20px 0;
}
}
@media (max-width: 1024px) {
.modal {
min-width: 80vw;
}
}
@media (max-width: 768px) {
.modal {
min-width: 90vw;
}
}
@media (max-width: 425px) {
.modal {
min-width: calc(100vw - 20px);
}
}
.modal__overlay {
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: transparent;
z-index: -1;
transition: all .2s ease;
display: none;
&.modal__overlay--open {
display: block;
z-index: 199;
opacity: 1;
background-color: rgba(0, 0, 0, 0.4);
}
}
.modal__trigger {
cursor: pointer;
}
.modal__trigger-label {
font-style: italic;
text-decoration: underline;
}
.modal__closer {
position: absolute;
top: 20px;
right: 20px;
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
background-color: var(--color-darker);
border-radius: 2px;
cursor: pointer;
z-index: 20;
&::before {
content: '\f00d';
font-family: 'Font Awesome 5 Free';
color: white;
}
}