Last active
March 15, 2019 00:32
-
-
Save chaoslogick/85f685c2442359bd5047bdbcad1aac89 to your computer and use it in GitHub Desktop.
SCSS: animation behaviors
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
// animation behaviors | |
// ------------------- | |
$cubic-bezier: cubic-bezier(0.4, 0.0, 0.2, 1); | |
@mixin cubic-bezier { | |
-webkit-transition: all 225ms cubic-bezier(0.4, 0.0, 0.2, 1); | |
transition: all 225ms cubic-bezier(0.4, 0.0, 0.2, 1); | |
} | |
@mixin transition($args...) { | |
-webkit-transition: $args; | |
-moz-transition: $args; | |
-ms-transition: $args; | |
-o-transition: $args; | |
transition: $args; | |
} | |
@mixin keyframes($animation-name) { | |
@-webkit-keyframes #{$animation-name} { | |
@content; | |
} | |
@-moz-keyframes #{$animation-name} { | |
@content; | |
} | |
@-ms-keyframes #{$animation-name} { | |
@content; | |
} | |
@-o-keyframes #{$animation-name} { | |
@content; | |
} | |
@keyframes #{$animation-name} { | |
@content; | |
} | |
} | |
@mixin animation($str) { | |
-webkit-animation: #{$str}; | |
-moz-animation: #{$str}; | |
-ms-animation: #{$str}; | |
-o-animation: #{$str}; | |
animation: #{$str}; | |
} | |
@include animation('animation 375ms 1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment