I'm trying to apply a keyframe animation to fade out an element, but when that class gets added to the element, it appears to adjust the rule itself and injects the className into the rule to reference the fadeOut
keyframe.
<div
className={cx({
[styles['announcement__sliderWrapper__single']]: true,
[styles['announcement__dismissed']]:
dismissedItems.includes(annnouncement.id)
})}
>
@keyframes fadeOut {
0% {
opacity: 100%;
}
99% {
opacity: 0%;
}
100% {
display: none;
}
}
.announcement__dismissed {
animation: fadeOut 5s 0 1; /* IE 10+, Fx 29+ */
}
This is what shows up in Chrome Dev Tools when the class is applied to the element:
.Announcements__announcement__dismissed___2-ucg {
-webkit-animation: Announcements__fadeOut___u8Ob- 5s 0 1;
animation: Announcements__fadeOut___u8Ob- 5s 0 1;
}