Created
January 23, 2014 04:58
-
-
Save krambuhl/8573100 to your computer and use it in GitHub Desktop.
Simple sass animation 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($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