Skip to content

Instantly share code, notes, and snippets.

@czajkovsky
Created August 5, 2014 06:14
Show Gist options
  • Save czajkovsky/6e14385ea41c07c18457 to your computer and use it in GitHub Desktop.
Save czajkovsky/6e14385ea41c07c18457 to your computer and use it in GitHub Desktop.
@mixin circle($size) {
@include size($size);
border-radius: 50%;
}
@mixin rounded-box($size, $corners) {
@include size($size);
@include inline-border-radius($corners);
}
@mixin inline-border-radius($args) {
@if length($args) == 4 {
$dirs: (top-left, 1),
(top-right, 2),
(bottom-right, 3),
(bottom-left, 4);
@each $dir, $i in $dirs {
border-#{$dir}-radius: nth($args, $i);
}
}
@else if length($args) == 2 {
@include border-top-radius(nth($args, 1));
@include border-bottom-radius(nth($args, 2));
}
@else if length($args) == 1 {
border-radius: $args;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment