JSFiddle - React, Tailwind, and code Playground

by ppgab

HTML

<button class="loading">
BotĂŁo
</button>

CSS

.loading::before {
    position:absolute;
    content : attr(loading-text);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1021;
    opacity: 0.9;
    pointer-events: none;
    cursor: wait;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000c;
    font-size: 1.7rem;
    padding: 1rem 1rem 1rem 1rem;
    text-align: center;
}
.loading::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 1px solid transparent;
    border-top-color: #0006;
    border-bottom-color: #0006;
    animation: spinner .8s ease infinite;
    z-index:1021;
}
.loading *{
    pointer-events: none;
}
.loading {
  position: relative;
  display: flex;
}

@keyframes spinner {
    to {transform: rotate(360deg);}
}

body{
  width: 100%;
  height: 100%
  
}