JSFiddle - React, Tailwind, and code Playground
HTML
<div class="modal">
<div class="dialog" data-role="popup">
<div class="content">
<header>header</header>
<main>main</main>
<footer>footer</footer>
</div>
</div>
</div>
CSS
.dialog {
}
.dialog .content {
background: #fff;
flex: 1;
width: 100%;
}
.dialog header {
padding: 1em;
}
.dialog main {
padding: 1em;
}
.dialog footer {
padding: 1em;
}
.dialog[data-role="popup"] {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.backdrop {
background: rgba(0,0,0,0.8);
}
.size-sm {
width: 100%;
max-width: 20em;
}
.size-md {
width: 100%;
max-width: 40em;
}
.size-lg {
width: 100%;
max-width: 60em;
}