_sidebar-width.scss
1 @mixin sidebar-width($borders, $width) { 2 $sidebar-width: $width; 3 4 @each $border in $borders { 5 $direction: nth($border, 1); 6 @if $direction == "all" { 7 $size: map-get(map-get($borders, $direction), size); 8 $sidebar-width: ($sidebar-width - (2 * $size)); 9 } @else if $direction == "right" { 10 $size: map-get(map-get($borders, $direction), size); 11 $sidebar-width: $sidebar-width - $size; 12 } @else if $direction == "left" { 13 $size: map-get(map-get($borders, $direction), size); 14 $sidebar-width: $sidebar-width - $size; 15 } 16 width: $sidebar-width; 17 } 18 }