JSFiddle - React, Tailwind, and code Playground
HTML
<div class=some-container>
<div class=box1>
</div>
<div class=box2-container>
<div class=box2>
</div>
</div>
</div>
CSS
.some-container {
top: 30px;
left: 30px;
position: relative;
}
.box1 {
width: 20px;
height: 20px;
background: red;
position: absolute;
}
.box2-container {
position: relative;
height: 20px;
width: 20px;
}
.box2 {
width: 40px;
height: 40px;
border: 2px solid blue;
position: absolute;
top: -50%; /* These values have to be changed when I want to recenter a new width and height from box1 */
left: -50%;
border-radius: 50%;
border-color: blue blue blue transparent;
border-width: 2px;
animation: box2-rotation 3s linear infinite;
}
@keyframes box2-rotation {
0% {transform: rotate(0deg);}
100% {transform: rotate(360deg);}
}