]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
responsive auto margin classes
authorMark Otto <markdotto@gmail.com>
Sun, 25 Dec 2016 02:11:43 +0000 (18:11 -0800)
committerMark Otto <markd.otto@gmail.com>
Sun, 25 Dec 2016 22:03:50 +0000 (14:03 -0800)
scss/utilities/_spacing.scss

index 1f0d77ff096ac92da730166e50ee84af335c3450..8750bb65b6651781a5df9567f81aad06f412d999 100644 (file)
 
 // Margin and Padding
 
-.mx-auto {
-  margin-right: auto !important;
-  margin-left:  auto !important;
-}
-
-.mr-auto { margin-right: auto !important; }
-.ml-auto { margin-left: auto !important; }
-
 @each $breakpoint in map-keys($grid-breakpoints) {
   @each $prop, $abbrev in (margin: m, padding: p) {
     @each $size, $lengths in $spacers {
       }
     }
   }
+
+  // Some special margin utils
+  @include media-breakpoint-up($breakpoint) {
+    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
+    .mx#{$infix}-auto {
+      margin-right: auto !important;
+      margin-left:  auto !important;
+    }
+    .mt#{$infix}-auto { margin-top: auto !important; }
+    .mr#{$infix}-auto { margin-right: auto !important; }
+    .mb#{$infix}-auto { margin-bottom: auto !important; }
+    .ml#{$infix}-auto { margin-left: auto !important; }
+  }
 }
 
 // Positioning