aboutsummaryrefslogtreecommitdiff
path: root/scss/utilities
diff options
context:
space:
mode:
authorRyan Worth <[email protected]>2018-06-07 16:39:58 +1000
committerGitHub <[email protected]>2018-06-07 16:39:58 +1000
commita2920149f43e80a411f2f2cf0dd43a84147a82b1 (patch)
tree7a186bfd6366860648e4f1fbcced462f46b65ebd /scss/utilities
parent9c3146d0dd1320d9b1e902005d5d6efe7d0e09d1 (diff)
downloadbootstrap-a2920149f43e80a411f2f2cf0dd43a84147a82b1.tar.xz
bootstrap-a2920149f43e80a411f2f2cf0dd43a84147a82b1.zip
Negative Margins classes for custom col gutters
Feature request #26681
Diffstat (limited to 'scss/utilities')
-rw-r--r--scss/utilities/_spacing.scss25
1 files changed, 25 insertions, 0 deletions
diff --git a/scss/utilities/_spacing.scss b/scss/utilities/_spacing.scss
index b2e2354b1..6191b9b96 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 {