diff --git a/docs/utilities/spacing.md b/docs/utilities/spacing.md index 045c4b2139a759342e277e6f057db2a398808ded..da89ecfa0e3f2e5cc99ed7d936719fb3cc39f6ef 100644 --- a/docs/utilities/spacing.md +++ b/docs/utilities/spacing.md @@ -29,6 +29,7 @@ Where *size* is one of: * `1` - (by default) for classes that set the `margin` or `padding` to `$spacer-x` or `$spacer-y` * `2` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 1.5` or `$spacer-y * 1.5` * `3` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 3` or `$spacer-y * 3` +* `auto` - for classes that set the `margin` to `auto` (You can add more sizes by adding entries to the `$spacers` Sass map variable.) @@ -53,8 +54,7 @@ Here are some representative examples of these classes: } {% endhighlight %} -### Horizontal centering -Additionally, Bootstrap also includes an `.m-x-auto` class for horizontally centering fixed-width block level content by setting the horizontal margins to `auto`. +The `.m-x-auto` class can be used for horizontally centering fixed-width block level content by setting the horizontal margins to `auto`. <div class="bd-example"> <div class="m-x-auto" style="width: 200px; background-color: rgba(86,61,124,.15);"> diff --git a/scss/_variables.scss b/scss/_variables.scss index 86a29e23c3355f7efab30ef37afcd933de5b4bee..897ef9d030c9600d3a14f92bd469230466609788 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -95,6 +95,10 @@ $spacers: ( 3: ( x: ($spacer-x * 3), y: ($spacer-y * 3) + ), + auto: ( + x: auto, + y: auto ) ) !default; $border-width: 1px !default; diff --git a/scss/utilities/_spacing.scss b/scss/utilities/_spacing.scss index b7ff044b6dba2dd2e9534f1a074800dbbdb677f2..8bb2d44d5b17f13ef2c7e1c13ef2dfab60755589 100644 --- a/scss/utilities/_spacing.scss +++ b/scss/utilities/_spacing.scss @@ -4,11 +4,6 @@ // Margin and Padding -.m-x-auto { - margin-right: auto !important; - margin-left: auto !important; -} - @each $prop, $abbrev in (margin: m, padding: p) { @each $size, $lengths in $spacers { $length-x: map-get($lengths, x);