Skip to content

Instantly share code, notes, and snippets.

@Tenderfeel
Created August 31, 2012 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tenderfeel/3554697 to your computer and use it in GitHub Desktop.
Save Tenderfeel/3554697 to your computer and use it in GitHub Desktop.
Sass 3.2 compatible vendor prefix mixin
$official:true; //Official
$support-for-webkit:true; //Chrome, Safari
$support-for-mozilla:true; //Firefox
$support-for-ie:true; //IE
$support-for-o:true; //Opera
@mixin prefix($property, $value...) {
@if $property == 'keyframes' {
@if $support-for-webkit { @-webkit-keyframes $value { @content; } }
@if $support-for-mozilla { @-mozilla-keyframes $value { @content; } }
@if $official {@keyframes $value { @content; } }
} @else {
@if $support-for-webkit {
-webkit-#{$property}: $value;
}
@if $support-for-mozilla {
-moz-#{$property}: $value;
}
@if $support-for-ie {
-ms-#{$property}: $value;
}
@if $support-for-o {
-o-#{$property}: $value;
}
@if $official {
#{$property}: $value;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment