Browse Source

css: Remove redundant spacers in _util

master
Annika Backstrom 7 months ago
parent
commit
2e6e46840d
Signed by: Annika Backstrom <annika@sixohthree.com> GPG Key ID: 1FB1723D467863F4
2 changed files with 3 additions and 31 deletions
  1. 3
    3
      assets/css/_spacers.scss
  2. 0
    28
      assets/css/_util.scss

+ 3
- 3
assets/css/_spacers.scss View File

@@ -2,7 +2,7 @@
// libsass (v3.3.2)
// ----

$spacer: 1rem;
$spacer: 6px;
$spacer-x: $spacer;
$spacer-y: $spacer;

@@ -22,7 +22,7 @@ $spacers: ();
$length-x: map-get($lengths, x);
$length-y: map-get($lengths, y);

.#{$abbrev}-a-#{$size} { #{$prop}: $length-y $length-x !important; } // a = All sides
.#{$abbrev}-#{$size} { #{$prop}: $length-y $length-x !important; } // a = All sides
.#{$abbrev}-t-#{$size} { #{$prop}-top: $length-y !important; }
.#{$abbrev}-r-#{$size} { #{$prop}-right: $length-x !important; }
.#{$abbrev}-b-#{$size} { #{$prop}-bottom: $length-y !important; }
@@ -38,4 +38,4 @@ $spacers: ();
#{$prop}-bottom: $length-y !important;
}
}
}
}

+ 0
- 28
assets/css/_util.scss View File

@@ -1,31 +1,3 @@
$multiplier: 6;

@mixin spacing-helper($property, $base) {
#{$property}: 1px * $base * $multiplier;
}


@mixin create-spacers($shortcut, $property) {
$i: 0;
@while $i < 6 {
.#{$shortcut}-#{$i} {
@include spacing-helper($property, $i);
}
$i: $i + 1;
}
}

@include create-spacers('p', 'padding');
@include create-spacers('pt', 'padding-top');
@include create-spacers('pb', 'padding-bottom');
@include create-spacers('pl', 'padding-left');
@include create-spacers('pr', 'padding-right');
@include create-spacers('m', 'margin');
@include create-spacers('mt', 'margin-top');
@include create-spacers('mb', 'margin-bottom');
@include create-spacers('ml', 'margin-left');
@include create-spacers('mr', 'margin-right');

.clear {
content: ".";
display: block;

Loading…
Cancel
Save