Skip to content

Commit

Permalink
fix comment placement, remove unecessary prop wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Jul 9, 2018
1 parent 0153f7d commit 7e96979
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions scss/utilities/_spacing.scss
Expand Up @@ -8,7 +8,6 @@

@each $prop, $abbrev in (margin: m, padding: p) {
@each $size, $length in $spacers {

.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
.#{$abbrev}t#{$infix}-#{$size},
.#{$abbrev}y#{$infix}-#{$size} {
Expand All @@ -29,32 +28,30 @@
}
}

// Some special margin utils

// Negative margins i.e. mb-n1 is the inverse or negative of mb-1
@each $prop, $abbrev in (margin: m) {
@each $size, $length in $spacers {

.#{$abbrev}#{$infix}-n#{$size} { #{$prop}: -$length !important; }
.#{$abbrev}t#{$infix}-n#{$size},
.#{$abbrev}y#{$infix}-n#{$size} {
#{$prop}-top: -$length !important;
// Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
@each $size, $length in $spacers {
@if not $size == 0 {
.m#{$infix}-n#{$size} { margin: -$length !important; }
.mt#{$infix}-n#{$size},
.my#{$infix}-n#{$size} {
margin-top: -$length !important;
}
.#{$abbrev}r#{$infix}-n#{$size},
.#{$abbrev}x#{$infix}-n#{$size} {
#{$prop}-right: -$length !important;
.mr#{$infix}-n#{$size},
.mx#{$infix}-n#{$size} {
margin-right: -$length !important;
}
.#{$abbrev}b#{$infix}-n#{$size},
.#{$abbrev}y#{$infix}-n#{$size} {
#{$prop}-bottom: -$length !important;
.mb#{$infix}-n#{$size},
.my#{$infix}-n#{$size} {
margin-bottom: -$length !important;
}
.#{$abbrev}l#{$infix}-n#{$size},
.#{$abbrev}x#{$infix}-n#{$size} {
#{$prop}-left: -$length !important;
.ml#{$infix}-n#{$size},
.mx#{$infix}-n#{$size} {
margin-left: -$length !important;
}
}
}

// Some special margin utils
.m#{$infix}-auto { margin: auto !important; }
.mt#{$infix}-auto,
.my#{$infix}-auto {
Expand Down

0 comments on commit 7e96979

Please sign in to comment.