]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Negative Margins classes for custom col gutters 26682/head
authorRyan Worth <garhbod@users.noreply.github.com>
Thu, 7 Jun 2018 06:39:58 +0000 (16:39 +1000)
committerGitHub <noreply@github.com>
Thu, 7 Jun 2018 06:39:58 +0000 (16:39 +1000)
Feature request #26681

scss/utilities/_spacing.scss

index b2e2354b126309957e658c9c6bcbb905097bfd4e..6191b9b9655265da9811b07b81dc7e35c1e58fac 100644 (file)
     }
 
     // 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 {