I have an animation like below:
@keyframes pulseColorGreen {
0% {
background-color: green;
}
97%{
background-color: green;
}
You can use CSS variable and you will need only one keyframes that you don't have to change. Simply change the main class that define the color:
.light {
--c: yellow;
}
.dark {
--c: darkblue;
}
.box {
height: 100px;
margin: 5px;
box-shadow: 0 0 5px var(--c);
color:#fff;
animation: pulseColorGreenMkt 1s infinite linear alternate;
}
@keyframes pulseColorGreenMkt {
0% {
background-color: var(--c);
}
100% {
background-color: black;
}
}
Class defined on the element
Class defined on a parent element