From a2920149f43e80a411f2f2cf0dd43a84147a82b1 Mon Sep 17 00:00:00 2001 From: Ryan Worth Date: Thu, 7 Jun 2018 16:39:58 +1000 Subject: [PATCH] Negative Margins classes for custom col gutters Feature request #26681 --- scss/utilities/_spacing.scss | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scss/utilities/_spacing.scss b/scss/utilities/_spacing.scss index b2e2354b12..6191b9b965 100644 --- a/scss/utilities/_spacing.scss +++ b/scss/utilities/_spacing.scss @@ -30,6 +30,31 @@ } // 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; + } + .#{$abbrev}r#{$infix}-n#{$size}, + .#{$abbrev}x#{$infix}-n#{$size} { + #{$prop}-right: -$length !important; + } + .#{$abbrev}b#{$infix}-n#{$size}, + .#{$abbrev}y#{$infix}-n#{$size} { + #{$prop}-bottom: -$length !important; + } + .#{$abbrev}l#{$infix}-n#{$size}, + .#{$abbrev}x#{$infix}-n#{$size} { + #{$prop}-left: -$length !important; + } + } + } + .m#{$infix}-auto { margin: auto !important; } .mt#{$infix}-auto, .my#{$infix}-auto { -- 2.47.2