I’ve transitioned my website from Shopify to WordPress, and unfortunately, my progress bar animations are no longer working correctly. The keyframe animations that previously functioned are not activating as expected.
HTML Example:
<div class="progress-bar-item">
<div class="weight-label">30 kg</div>
<div class="progress-wrapper primary-progress">
<div class="filled-progress">
</div>
</div>
<div class="name-label">Sample Item 1</div>
</div>
<div class="progress-bar-item">
<div class="weight-label">22 kg</div>
<div class="progress-wrapper secondary-progress">
<div class="filled-progress">
</div>
</div>
<div class="name-label">Sample Item 2</div>
</div>
CSS Snippet:
.progress-wrapper {
width: 350px;
margin: 0 0 2px;
}
.filled-progress {
position: relative;
height: 14px;
border-radius: 6px;
overflow: hidden;
background: #ccc;
}
.filled-progress::before {
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 0;
background: #f6953d;
border-radius: 6px;
}
.primary-progress .filled-progress::before {
animation: fill-primary 1s ease-in forwards;
}
.secondary-progress .filled-progress::before {
animation: fill-secondary 1s ease-in forwards;
}
@keyframes fill-primary {
to {
width: 80%;
}
}
@keyframes fill-secondary {
to {
width: 45%;
}
}
I can see the bars but they aren’t animating at all. I suspect the problem might be related to the CSS class selectors not matching properly with my HTML structure. Any suggestions on what could be causing this issue?