Skip to content

Instantly share code, notes, and snippets.

@danmartin
Last active January 1, 2016 20:34
Show Gist options
  • Save danmartin/6a91847cf14d043db7d1 to your computer and use it in GitHub Desktop.
Save danmartin/6a91847cf14d043db7d1 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
// Set sides and all as a list of booleans
$border-radius-list: (
all : (true, true, true, true),
top : (true true false false),
bottom : (false, false, true, true),
left : (true false false true),
right : (false, true, true, false),
);
@mixin border-radius ($side: all, $size: 5px) {
// Grab Boolean list of values based on given $side parameter
$bools: map-get($border-radius-list, $side);
$rad-list:(); // Set value list as empty variable to be appended in each loop below
@each $bool in $bools{
// If value in loop is true append $rad-list with size parameter, else 0
$rad-list: if($bool, append($rad-list,$size), append($rad-list,0px));
}
// Once loop is complete append the rad-list value to the corresponding property declaration.
border-radius: $rad-list;
-moz-border-radius: $rad-list;
-webkit-border-radius: $rad-list;
}
#order-progress {
display:100%;
margin:0;
li{
&:first-child {
@include border-radius(left);
}
&:last-child {
@include border-radius(right);
}
}
}
#order-progress {
display: 100%;
margin: 0;
}
#order-progress li:first-child {
border-radius: 5px 0px 0px 5px;
-moz-border-radius: 5px 0px 0px 5px;
-webkit-border-radius: 5px 0px 0px 5px;
}
#order-progress li:last-child {
border-radius: 0px 5px 5px 0px;
-moz-border-radius: 0px 5px 5px 0px;
-webkit-border-radius: 0px 5px 5px 0px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment