Skip to content

Instantly share code, notes, and snippets.

@gruppjo
Last active August 29, 2015 13:56
Show Gist options
  • Save gruppjo/8804606 to your computer and use it in GitHub Desktop.
Save gruppjo/8804606 to your computer and use it in GitHub Desktop.
css: loading animation - basic
// inspired by http://codepen.io/anon/pen/fGatk
// don't use on :before in older Webkits (e.g iOS6) - http://css-tricks.com/pseudo-element-animationstransitions-bug-fixed-in-webkit/
@mixin loading($radius, $width, $bgColor, $fgColor) {
display:inline-block;
width: $radius;
height: $radius;
@include border-radius(50%);
background-color: transparent;
animation: rotate .75s infinite linear;
-webkit-animation: rotate .75s infinite linear;
border-left: $width solid $bgColor;
border-bottom: $width solid $bgColor;
border-right: $width solid $bgColor;
border-top: $width solid $fgColor;
}
@keyframes rotate {
from{
transform: rotate(0deg);
}
to{
transform: rotate(360deg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment