-
-
Save vasiliy0s/a49a9877e7019ef1c608 to your computer and use it in GitHub Desktop.
@mixin border-radius
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
@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