@aamal/p14-plugin-modale
Version:
The `p14-plugin-modal` as its name suggests, is a plugins developed as part of my OpenClassRooms training program. It is a React plugin allowing to display a modal alert, for more information go to the section "How the plugin works" ## Installation ```
87 lines (78 loc) • 1.96 kB
CSS
.modal {
position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10;
overflow-y: auto;
}
.modal-container {
display: flex; justify-content: center; align-items: center;
min-height: 100vh;
padding: 1rem 1rem 5rem;
text-align: center;
}
.modal-overlay {
position: fixed; top: 0; right: 0; bottom: 0; left: 0;
background-color: rgba(0, 0, 0, .5);
transition: opacity 200ms linear;
}
.modal-spacer {
display: none;
/* on phone
display: inline-block;
min-height: 100vh;
vertical-align: middle;
*/
}
.modal-wrapper {
/* sm:my-8 sm:align-middle sm:max-w-lg sm:w-full */
position: relative;
display: inline-block;
max-width: 40rem;
vertical-align: bottom;
overflow: hidden;
border-radius: 0.5rem;
background-color: #fff;
box-shadow: rgba(0, 0, 0, 0.1) 0px 20px 25px -5px,
rgba(0, 0, 0, 0.04) 0px 10px 10px -5px;
text-align: left;
transition: all 200ms linear;
}
.alert-modal {
position: relative;
display: grid;
grid-template-columns: auto 1fr;
grid-template-rows: auto auto auto;
gap: 1rem 2rem;
margin: 2rem;
grid-auto-flow: row;
grid-template-areas:
"icon title"
"icon content"
"actions actions";
}
.modal-close {
position: absolute; top: 1.8rem; right: 1.8rem;
display: flex; justify-content: center; align-items: center;
width: 2rem; height: 2rem;
border-radius: 2rem;
}
.modal-close:hover {
background-color: #E7E5E4;
}
.modal-close svg {
width: 1.5rem; height: 1.5rem;
fill: currentColor;
color: #44403C;
}
.alert-modal-title {
grid-area: title;
color: #1C1917;
font-weight: 600;
font-size: 1.2rem;
}
.modal-content {
grid-area: content;
}
.modal-actions {
grid-area: actions;
display: flex; justify-content: flex-end;
gap: 2rem;
}