question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, problem is in transform: rotate(360deg); I using tailwind.css and if I use animate-spin class to span icon, style transform for svg, does not allow adding animation.

P.S.

.animate-spin{
animation: spin 1s linear infinite;
}

@keyframes spin {
from {
transform: rotate(0deg);
}   to {
transform: rotate(360deg);
} 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cyberaliencommented, Dec 14, 2020

It is caused by bug in Tailwind. This is their spin animation code:

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

There is no “from”, so it transforms from initial state. SVG rendered by Iconify have style set to transform: rotate(360deg) to fix SVG rendering bug in Firefox. Because initial state matches final state, no animation happens.

You can test that by using this:

<p class="animate-spin w-7" style="transform: rotate(0deg);">example 1</p>
<p class="animate-spin w-7" style="transform: rotate(360deg);">example 2</p>

First example will spin, second example will not, even though their style has identical layout.

Workaround is to set transformation on icon:

<span class="iconify animate-spin" data-icon="uil:spin" style="transform: none;"></span>
0reactions
cyberaliencommented, Jan 8, 2021

Firefox bug has been fixed for a while, so it is a legacy support. In the latest version of SVG framework I’ve removed that code because latest version of browser + few previous versions do not have that bug anymore, so it is safe to remove workaround.

Update to SVG framework 2.0.0-rc.5

Bugzilla issue: https://bugzilla.mozilla.org/show_bug.cgi?id=608812

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animation - Wikipedia
Animation is a method by which still figures are manipulated to appear as moving images. In traditional animation, images are drawn or painted...
Read more >
Animation Magazine: Home
TV & Streaming Bytes: December Series Sales · Animation Magazine - 4 days ago.
Read more >
Animation | History, Movies, Television, & Facts | Britannica
animation, the art of making inanimate objects appear to move. Animation is an artistic impulse that long predates the movies.
Read more >
Animaker, Make Animated Videos on Cloud for free
Animaker is an online do-it-yourself (#DIY) animation video maker that brings studio quality presentations within everyone's reach. Animated Videos ...
Read more >
Animation Desk | The Best Animation App - Kdan Mobile
Animation Desk is a free animation app available on iPad, iPhone, ... The simple and beautiful software for creating animation, cartoons, and animatics....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found