Last active
October 11, 2015 09:27
-
-
Save snowman-repos/3838110 to your computer and use it in GitHub Desktop.
SASS: Animation Mixin
This file contains 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 keyframes($name) { | |
@-webkit-keyframes #{$name} { | |
@content | |
} | |
@-moz-keyframes #{$name} { | |
@content | |
} | |
@-ms-keyframes #{$name} { | |
@content | |
} | |
@-o-keyframes #{$name} { | |
@content | |
} | |
@keyframes #{$name} { | |
@content | |
} | |
} | |
@mixin animation($value) { | |
-webkit-animation: $value; | |
-moz-animation: $value; | |
-ms-animation: $value; | |
-o-animation: $value; | |
animation: $value; | |
} | |
@include keyframes(move) { | |
0% { left: 0; } | |
100% { left: 100px; } | |
} | |
.box { | |
@include animation(move 0.5s ease infinite alternate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment