Say I have a spinning animation that looks like this:
@keyframes spinning {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
I can use it like this:
.spinning {
animation: spinning 1s infinite;
}
I also have a "skewing" animation:
@keyframes skewing {
0% {
transform: skew(0deg);
}
25% {
transform: skew(40deg);
}
50% {
transform: skew(0deg);
}
75% {
transform: skew(-40deg);
}
100% {
transform: skew(0deg);
}
}
How can I apply those two animations to the same element? Since they both use transform, they trample on each other, and on any other static transform property I try to include:
.fun { // doesn't work - pick one of three :(
animation: spinning 1s infinite;
animation: skewing 1s infinite;
&:hover {
transform: scale(2.0)
}
}
I realize I can combine all the transforms by hand into one big mega-keyframes -- but then I've lost the usefulness of having reusable, composable animations. Is it possible to compose these somehow?