Last active
December 12, 2015 00:19
-
-
Save 2ndkauboy/4683007 to your computer and use it in GitHub Desktop.
A simple mixins to use CSS3 anmiations in SASS with all vendor prefixes and the possibility to set any specific animation property.
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 animation($value) { | |
-webkit-animation: unquote($value); | |
-moz-animation: unquote($value); | |
-o-animation: unquote($value); | |
animation: unquote($value); | |
} | |
@mixin animation-property($property, $value) { | |
-webkit-animation-#{$property}: unquote($value); | |
-moz-animation-#{$property}: unquote($value); | |
-o-animation-#{$property}: unquote($value); | |
animation-#{$property}: unquote($value); | |
} | |
@mixin keyframes($name) { | |
@-webkit-keyframes #{$name} { @content; } | |
@-moz-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
Example:
A button that changes it's background color in an infinite loop, while the process it triggered is working: