0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-28 20:52:21 +01:00

responsive auto margin classes

This commit is contained in:
Mark Otto 2016-12-24 18:11:43 -08:00 committed by Mark Otto
parent f99d179690
commit 4f85513608

View File

@ -15,14 +15,6 @@
// 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 {
@ -48,6 +40,19 @@
}
}
}
// 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