Skip to content

Instantly share code, notes, and snippets.

@vasiliy0s
Forked from anthonyshort/gist:1178298
Created November 19, 2014 06:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vasiliy0s/a49a9877e7019ef1c608 to your computer and use it in GitHub Desktop.
Save vasiliy0s/a49a9877e7019ef1c608 to your computer and use it in GitHub Desktop.
@mixin border-radius
@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