Skip to content

Instantly share code, notes, and snippets.

@snowman-repos
Last active October 11, 2015 09:27
Show Gist options
  • Save snowman-repos/3838110 to your computer and use it in GitHub Desktop.
Save snowman-repos/3838110 to your computer and use it in GitHub Desktop.
SASS: Animation Mixin
@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