Skip to content

Instantly share code, notes, and snippets.

@krambuhl
Created January 23, 2014 04:58
Show Gist options
  • Save krambuhl/8573100 to your computer and use it in GitHub Desktop.
Save krambuhl/8573100 to your computer and use it in GitHub Desktop.
Simple sass animation mixins
@mixin animation($animate...) {
$max: length($animate);
$animations: '';
@for $i from 1 through $max {
$animations: #{$animations + nth($animate, $i)};
@if $i < $max {
$animations: #{$animations + ", "};
}
}
-webkit-animation: $animations;
-moz-animation: $animations;
-ms-animation: $animations;
-o-animation: $animations;
animation: $animations;
}
@mixin keyframes($name) {
@-webkit-keyframes #{$name} { @content; }
@-moz-keyframes #{$name} { @content; }
@-ms-keyframes #{$name} { @content; }
@-o-keyframes #{$name} { @content; }
@keyframes #{$name} { @content; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment