-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generic anim-rotate-360 class for use by view_components/spinner. #1251
Add generic anim-rotate-360 class for use by view_components/spinner. #1251
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/primer/primer-css/mPHsvkXS5vQA7Uk5GwyoZwHFNrkK |
There is currently
|
👍 I don't think the 360 added anything.
👍 Added with a rotating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇 Thanks for the updates. Ok, let's get it into 16.0.0
#1241.
The current implementation of
SpinnerComponent
inprimer/view_components
uses an SVG with SMIL animations to render a spinner that spins indefinitely. This unfortunately triggers a bug in Chrome that is very frustrating for users, where a page with SVGs with infinitely-repeating SMIL animations that is placed in the background will trigger a linear task to emit, then run, events for each frame that would have been run, as soon as the page is returned to the foreground. This execution is linear to the number of SVGs with repeating SMIL animations multiplied by the duration the tab is in the background. For GitHub.com webpages, this can take seconds, or even minutes, where the Chrome tab is frozen, or even locking up the entire OS if memory is limited.This PR is the first of 2 parts, it implements a simple CSS class that rotates an element 360 degrees repeatedly. It is not possible to directly include this inside the SpinnerComponent itself because CSS keyframes seem to need to be included in a full CSS file and not inline styles, and since this was a very simple/generic animation that could easily be reused, it seemed nicest to include this here as a generic
anim-rotate-360
class.The following change becomes possible with this in the CSS, with both being identical, except that the second uses CSS animations which do not trigger this bug:
/cc @primer/ds-core
/cc primer/view_components#398 which uses this new class