Created
February 25, 2014 13:23
-
-
Save mturjak/9208634 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
| // ---- | |
| // Sass (v3.2.14) | |
| // Compass (v0.12.2) | |
| // ---- | |
| // loops through all arguments and prefixes the ones that need it (in this case only transform) | |
| @function vendor-args($arg, $vendor) { | |
| $result: (); | |
| @each $i in $arg { | |
| @if $i == transform { $result: append($result, #{$vendor}$i); } | |
| @else { $result: append($result, $i); } | |
| } | |
| @return $result; | |
| } | |
| // general vendor mixin | |
| @mixin vendor($property, $args...){ | |
| @each $vendor in ('-webkit-', '-moz-', '-ms-', '-o-', '') { | |
| $out: null; | |
| @each $arg in nth($args,1) { | |
| $out: ($out, vendor-args($arg, $vendor)); | |
| } | |
| #{$vendor}#{$property}: $out; | |
| } | |
| } | |
| // general transition mixin | |
| @mixin transition($args...) { | |
| @include vendor(transition, $args); | |
| } | |
| // test | |
| test { | |
| @include transition( transform .3s ease-in-out, color .2s linear ); | |
| } |
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
| test { | |
| -webkit-transition: -webkit-transform 0.3s ease-in-out, color 0.2s linear; | |
| -moz-transition: -moz-transform 0.3s ease-in-out, color 0.2s linear; | |
| -ms-transition: -ms-transform 0.3s ease-in-out, color 0.2s linear; | |
| -o-transition: -o-transform 0.3s ease-in-out, color 0.2s linear; | |
| transition: transform 0.3s ease-in-out, color 0.2s linear; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment