Animated Variables
Use variables inside transitions and keyframes for dynamic, data-driven animations.
Use variables inside transitions and keyframes for dynamic, data-driven animations.
:root { --progress: 0%; }
.bar { width: var(--progress); height: 8px; background: steelblue; transition: width 0.4s; }
@keyframes fill { from { width: 0; } to { width: var(--target, 100%); } }
Transitions react to variable changes automatically — no JS class toggling needed.