Created
January 20, 2012 01:07
-
-
Save doctyper/1644192 to your computer and use it in GitHub Desktop.
Just some animation SCSS mixins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin animation($animation, $animation-2: none, $animation-3: none) { | |
@each $prefix in webkit, moz, ms { | |
#{""}-#{$prefix}-animation: $animation, $animation-2, $animation-3; | |
} | |
} | |
@mixin animation-name($name) { | |
@include experimental(animation-name, $name); | |
} | |
@mixin animation-duration($duration) { | |
@include experimental(animation-duration, $duration); | |
} | |
@mixin animation-delay($delay) { | |
@include experimental(animation-delay, $delay); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mixin animation($name, $length:1000ms, $ease:ease, $delay:0ms, $iteration:1, $alternate:normal, $fillmode:both, $backface:hidden) {
-webkit-animation-name: $name;
-webkit-animation-duration:$length;
-webkit-animation-iteration-count: $iteration;
-webkit-animation-timing-function: $ease;
-webkit-animation-delay: $delay;
-webkit-animation-direction: $alternate;
-webkit-animation-fill-mode: $fillmode;
-webkit-backface-visibility: $backface;
// enables hardware acceleration
-webkit-transform: translateZ(0);
-moz-animation: translateZ(0);
-ms-animation: translateZ(0);
-o-animation: translateZ(0);
animation: translateZ(0);
}