parent
b28f37d8b7
commit
dc9c10b58f
@ -1,8 +0,0 @@
|
||||
$unit: 8px;
|
||||
|
||||
$xsmall: $unit / 4; // 2px
|
||||
$small: $unit / 2; // 4px
|
||||
$medium: $unit; // 8px
|
||||
$large: $unit * 2; // 16px
|
||||
$xlarge: $unit * 3; // 24px
|
||||
$xxlarge: $unit * 4; // 32px
|
||||
@ -1,5 +1,3 @@
|
||||
@import "sizes";
|
||||
|
||||
.border-radius-8 {
|
||||
border-radius: $unit;
|
||||
border-radius: 8px;
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
@import 'sizes';
|
||||
|
||||
.pv80 {
|
||||
padding-top: 80px;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.ph120 {
|
||||
padding-left: 120px;
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
$whitespace-keys: (p padding, m margin, a '', v -top -bottom, h -left -right, t -top, r -right, b -bottom, l -left);
|
||||
|
||||
@function expand_whitespace_key($key) {
|
||||
@each $pair in $whitespace-keys {
|
||||
$short: nth($pair, 1);
|
||||
$long: nth($pair, 2);
|
||||
|
||||
// v and h need to pass in 2 parameters
|
||||
@if (length($pair) == 3) {
|
||||
$long: (nth($pair, 2) nth($pair, 3));
|
||||
}
|
||||
@if $short == $key {
|
||||
@return $long;
|
||||
}
|
||||
}
|
||||
@warn "Couldn't export #{$key}";
|
||||
@return $key;
|
||||
}
|
||||
|
||||
$types: (p, m);
|
||||
$locations: (a, v, h, t, r, b, l);
|
||||
$t-shirt-sizes: (n, xs, s, m, l, xl, xxl);
|
||||
|
||||
@mixin whitespace($units: ()) {
|
||||
$units: join(0, $units);
|
||||
|
||||
@for $i from 1 through length($units) {
|
||||
$t-shirt-size: nth($t-shirt-sizes, $i);
|
||||
$size: nth($units, $i);
|
||||
|
||||
@each $location in $locations {
|
||||
@each $type in $types {
|
||||
.#{$type}#{$location}#{$t-shirt-size} {
|
||||
@each $whitespace-location in expand_whitespace_key($location) {
|
||||
#{expand_whitespace_key($type)}#{$whitespace-location}: $size !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include whitespace(($xsmall, $small, $medium, $large, $xlarge, $xxlarge));
|
||||
Loading…
Reference in new issue