Created
March 12, 2014 15:29
-
-
Save DarbyBrown/9509234 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.3.1) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
$vendors-no-ms: '-webkit-' '-moz-' '-o-' '' !default; | |
// Return vendor-prefixed property names if appropriate | |
// Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background | |
//************************************************************************// | |
@function transition-property-names($props, $vendor: false) { | |
$new-props: (); | |
@each $prop in $props { | |
$new-props: append($new-props, transition-property-name($prop, $vendor), comma); | |
} | |
@return $new-props; | |
} | |
@function transition-property-name($prop, $vendor: false) { | |
// put other properties that need to be prefixed here aswell | |
@if $vendor and $prop == transform { | |
@return unquote('-'+$vendor+'-'+$prop); | |
} | |
@else { | |
@return $prop; | |
} | |
} | |
@mixin transition-property ($properties...) { | |
-webkit-transition-property: transition-property-names($properties, 'webkit'); | |
-moz-transition-property: transition-property-names($properties, 'moz'); | |
transition-property: transition-property-names($properties, 'webkit'); | |
transition-property: transition-property-names($properties, false); | |
} | |
div{ | |
@include transition-property(transform, opacity, color) | |
} |
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
div { | |
-webkit-transition-property: -webkit-transform, opacity, color; | |
-moz-transition-property: -moz-transform, opacity, color; | |
transition-property: -webkit-transform, opacity, color; | |
transition-property: transform, opacity, color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment