JSFiddle - React, Tailwind, and code Playground
by poonia
HTML
<div class="spinner"/>
CSS
@keyframes spinner {
to {transform: rotate(360deg);}
}
@-webkit-keyframes spinner {
to {-webkit-transform: rotate(360deg);}
}
.spinner {
min-width: 24px;
min-height: 24px;
position: absolute;
top: 10px;
left: 10px;
}
.spinner:before {
content: 'Loading…';
position: absolute;
top: 50%;
left: 50%;
width: 16px;
height: 16px;
margin-top: -10px;
margin-left: -10px;
}
.spinner:not(:required):before {
content: '';
border-radius: 50%;
border-top: 2px solid #ff8c00;
border-right: 2px solid transparent;
animation: spinner .6s linear infinite;
-webkit-animation: spinner .6s linear infinite;
}