Skip to content

Instantly share code, notes, and snippets.

@kamalx
Forked from anthonyshort/gist:1178298
Last active August 29, 2015 14:25
Show Gist options
  • Save kamalx/5f92c855ea75dfeaf0cb to your computer and use it in GitHub Desktop.
Save kamalx/5f92c855ea75dfeaf0cb to your computer and use it in GitHub Desktop.
@mixin border-radius($radius, $prefixes: -moz -webkit -o) {
@each $prefix in $prefixes {
#{$prefix}-border-radius:$radius;
}
border-radius:$radius;
}
#id {
@include border-radius(5px, -moz -webkit);
}
// Gives you
#id {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
// Or make it even more generic
@mixin prefix($property, $value, $prefixes) {
@each $prefix in $prefixes {
#{$prefix}-#{$property}:$value;
}
#{$property}:$value;
}
@mixin border-radius($radius, $prefixes: -moz -webkit -o) {
@include prefix(border-radius,$radius,$prefixes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment