Skip to content

Instantly share code, notes, and snippets.

@xifengzhu
Last active August 29, 2015 14:04
Show Gist options
  • Save xifengzhu/a14bba07a2cdbf055e7b to your computer and use it in GitHub Desktop.
Save xifengzhu/a14bba07a2cdbf055e7b to your computer and use it in GitHub Desktop.
//prefixer
@mixin prefixer ($property, $value, $prefixes) {
@each $prefix in $prefixes {
@if $prefix == webkit and $prefix-for-webkit == true {
-webkit-#{$property}: $value;
}
@else if $prefix == moz and $prefix-for-mozilla == true {
-moz-#{$property}: $value;
}
@else if $prefix == ms and $prefix-for-microsoft == true {
-ms-#{$property}: $value;
}
@else if $prefix == o and $prefix-for-opera == true {
-o-#{$property}: $value;
}
@else if $prefix == spec and $prefix-for-spec == true {
#{$property}: $value;
}
@else {
@warn "Unrecognized prefix: #{$prefix}";
}
}
}
@mixin skewX($degrees) {
@include prefixer(transform, skewX($degrees), webkit moz o ms spec);
-webkit-backface-visibility: hidden;
}
@mixin border-radius($values) {
-webkit-border-radius: $values;
-moz-border-radius: $values;
border-radius: $values;
}
div {
@ include border-radius(10px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment