formstone
Version:
Library of modular front end components.
100 lines (90 loc) • 1.86 kB
CSS
.fs-modal {
--fs-modal-duration: 0.25s;
--fs-modal-timing: linear;
--fs-modal-overlay-bg: rgba(0, 0, 0, 0.9);
--fs-modal-container-bg: #fff;
--fs-modal-button-background: #fff;
--fs-modal-button-color: #000;
height: 100vh;
width: 100vw;
z-index: 999;
opacity: 0;
transition: opacity var(--fs-modal-duration) var(--fs-modal-timing);
}
@media (prefers-reduced-motion) {
.fs-modal {
--fs-modal-duration: 0s;
--fs-modal-loading-duration: 0s;
--fs-modal-item-duration: 0s;
}
}
.fs-modal,
.fs-modal * {
box-sizing: border-box;
}
.fs-modal-open {
opacity: 1;
}
.fs-modal,
.fs-modal-overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.fs-modal-overlay {
z-index: 0;
background: var(--fs-modal-overlay-bg);
}
.fs-modal-sr {
width: 1px ;
height: 1px ;
position: absolute ;
border-width: 0 ;
clip: rect(0, 0, 0, 0) ;
margin: -1px ;
overflow: hidden ;
padding: 0 ;
white-space: nowrap ;
}
.fs-modal-container {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
user-select: none;
}
.fs-modal-wrap {
max-width: 100%;
max-height: 100%;
position: relative;
background: var(--fs-modal-container-bg);
overflow: auto;
}
.fs-modal-close {
display: flex;
align-items: center;
justify-content: center;
height: 40px;
width: 40px;
position: absolute;
top: env(safe-area-inset-top, 0px);
right: env(safe-area-inset-right, 0px);
z-index: 2;
appearance: none;
background: var(--fs-modal-button-background);
border: none;
color: var(--fs-modal-button-color);
cursor: pointer;
padding: 0;
}
.fs-modal-close svg {
width: 30px;
}