It'd be great if there was a class you could attach to an icon-* to have it spin in the reverse direction. It's easily doable by just adding the 'reverse' keyword to the animation, but it'd be great to have a class like icon-spin-reverse.
.icon-spin-reverse {
-moz-animation: spin 2s infinite linear reverse;
-o-animation: spin 2s infinite linear reverse;
-webkit-animation: spin 2s infinite linear reverse;
animation: spin 2s infinite linear reverse;
}
Or a chainable class:
.icon-spin.icon-spin-reverse {
-moz-animation-direction: reverse;
-o-animation-direction: reverse;
-webkit-animation-direction: reverse;
animation-direction: reverse;
}
reverse
was added to the CSS3 spec relatively recently, and only Firefox 16+ and Chrome 19+ support it. Alternatively, it could be done by just inverting the spin keyframes for a spin-reverse class.
+1
+1, this seems totally obvious, but maybe because I've dropped support for IE9 now than 10+11 are out.
+1
+1
+1
+1 :+1:
+1
+1
+1
+1
+1
+1
+1
do you know browser support of reverse
?
I'm concerned it is not enough and we have to duplicate the whole animation
+1
+1
:+1:
+1
Here is another code. Based on fa-spin class. Just add to your css file.
.fa-spin-reverse {
-webkit-animation: fa-spin-reverse 2s infinite linear;
animation: fa-spin-reverse 2s infinite linear;
}
@-webkit-keyframes fa-spin-reverse {
100% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
0% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes fa-spin-reverse {
100% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
0% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
to use:
<i class="fa fa-spin-reverse fa-cog"></i>
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
Most helpful comment
Here is another code. Based on fa-spin class. Just add to your css file.
to use: