Created
August 5, 2014 06:14
-
-
Save czajkovsky/6e14385ea41c07c18457 to your computer and use it in GitHub Desktop.
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 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