Here’s a way to do this using CSS variables:
<div style="--from-width:10px; --to-width:20px; animation: load 3s normal forwards;"></div>
OR
<div style="--from-width:10px; --to-width:20px;" class="animation"></div>
.animation {
animation: load 3s normal forwards;
}
@keyframes load {
from {
width: var(--from-width);
}
to {
width: var(--to-width);
}
}