Created
September 21, 2014 14:58
-
-
Save Manoz/1a0a8aed80334909bc9b 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
// Keyframe animations | |
// # Use: `@include animation('ANIM_NAME DURATION ITERATION_COUNT');` | |
@mixin keyframes($animation-name) { | |
@-webkit-keyframes $animation-name { | |
@content; | |
} | |
@-moz-keyframes $animation-name { | |
@content; | |
} | |
@keyframes $animation-name { | |
@content; | |
} | |
} | |
@mixin animation($str) { | |
-webkit-animation: #{$str}; | |
animation: #{$str}; | |
} |
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
@include keyframes(my-animation) { | |
0% { opacity: 1; } | |
90% { opacity: 0; } | |
} | |
.something { | |
@include animation('my-animation 5s infinite'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment