I have the following style block:
@keyframes flip {
0% {
transform: rotateX(0);
}
50% {
transform: rotateX(90deg);
background-color: UNKNOWN;
}
100% {
transform: rotateX(0);
}
}
For the animation to work nicely, I need to change the background color at 50%
. The problem is that some JavaScript function will decide what that color should be. Is accessing the stylesheet with JavaScript my only option to deal with such a case?
Edit
Suppose I have three objects next to each other, and they independently obtain their color through some JavaScript function. How does CSS var()
deal with that?