Created
February 25, 2014 13:31
-
-
Save mturjak/9208748 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) | |
| // ---- | |
| @function needs-vendor($p){ | |
| $l: transform, another-property-you-want-prefixed, and-another; | |
| @each $i in $l { | |
| @if $i == $p { @return terue; } | |
| } | |
| @return false; | |
| } | |
| @function vendor-args($arg, $vendor) { | |
| $result: (); | |
| @each $i in $arg { | |
| @if needs-vendor($i) { $result: append($result, #{$vendor}$i); } | |
| @else { $result: append($result, $i); } | |
| } | |
| @return $result; | |
| } | |
| @mixin vendor($property, $args, $vendors: ('-webkit-', '-moz-', '-ms-', '-o-', '')){ | |
| @each $vendor in $vendors { | |
| $out: null; | |
| @each $arg in $args { | |
| $out: ($out, vendor-args($arg, $vendor)); | |
| } | |
| #{$vendor}#{$property}: $out; | |
| } | |
| } | |
| @mixin transition($args...) { | |
| @include vendor(transition, $args, ('-webkit-', '-moz-', '-o-', '')); | |
| } | |
| test { | |
| @include transition( transform .3s ease-in-out, all 1s ); | |
| } |
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, all 1s; | |
| -moz-transition: -moz-transform 0.3s ease-in-out, all 1s; | |
| -o-transition: -o-transform 0.3s ease-in-out, all 1s; | |
| transition: transform 0.3s ease-in-out, all 1s; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment