Skip to content

Instantly share code, notes, and snippets.

@BumbuKhan
Created February 14, 2017 21:32
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 BumbuKhan/9e4d51c19bff09dad8c3f3b5e4b67758 to your computer and use it in GitHub Desktop.
Save BumbuKhan/9e4d51c19bff09dad8c3f3b5e4b67758 to your computer and use it in GitHub Desktop.
Border radius @mixin
@mixin border-radius-partial($radius, $part:null) {
@if ($part) {
-webkit-border-#{$part}-radius: $radius;
-moz-border-#{$part}-radius: $radius;
-ms-border-#{$part}-radius: $radius;
border-#{$part}-radius: $radius;
}
@else {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
}
@mixin border-radius($radius, $top-right:null, $bottom-right:null, $bottom-left:null, $top-left:null) {
@if ($top-right or $bottom-right or $bottom-left or $top-left) {
@if ($top-right) {
@include border-radius-partial($radius, 'top-right');
}
@if ($bottom-right) {
@include border-radius-partial($radius, 'bottom-right');
}
@if ($bottom-left) {
@include border-radius-partial($radius, 'bottom-left');
}
@if ($top-left) {
@include border-radius-partial($radius, 'top-left');
}
}
@else {
@include border-radius-partial($radius);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment