JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div id="child"></div>
</div>
CSS
@keyframes width {
from { width: 50px }
to { width: 400px }
}
#parent {
border: 2px solid;
animation: width 1s alternate infinite;
}
#child {
padding: 50%;
background: red;
}