JSFiddle - React, Tailwind, and code Playground
HTML
<div class="loader"></div>
SCSS
body {
background: #222;
}
.loader {
position: relative;
width: 200px;
height: 200px;
background: #fff;
border-radius: 50%;
&:before, &:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
border-radius: 50%;
transform: translate(-50%, -50%);
}
&:before {
width: 40px;
height: 40px;
background: #fff;
z-index: 3;
}
&:after {
width: 60px;
height: 60px;
background: conic-gradient(#417AFE 0%, #EE82EE00 100%);
animation: loader 3s infinite linear;
z-index: 2;
}
}
@keyframes loader {
100% {
transform: translate(-50%, -50%) rotate(360deg);
}
}