diff options
| author | Mark Otto <[email protected]> | 2016-02-06 15:40:25 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-02-06 15:40:25 -0800 |
| commit | c59dbe56fe07cadf4ad09659d65d7090a07f2fbb (patch) | |
| tree | 44f375c72e41f567d430e1ff70a591acc89282eb | |
| parent | 612b824ae022a5e41f485c4a8d7b289bceebbc4e (diff) | |
| download | bootstrap-c59dbe56fe07cadf4ad09659d65d7090a07f2fbb.tar.xz bootstrap-c59dbe56fe07cadf4ad09659d65d7090a07f2fbb.zip | |
Drop .center-block for .m-x-auto
- Both classes do about the same thing, but with different names
- Clarifies docs for .m-x-auto requiring a fixed width block element for it to work
- Add missing heading for clearfix section in docs (unrelated)
| -rw-r--r-- | docs/components/utilities.md | 35 | ||||
| -rw-r--r-- | scss/_mixins.scss | 1 | ||||
| -rw-r--r-- | scss/_utilities.scss | 1 | ||||
| -rw-r--r-- | scss/mixins/_center-block.scss | 7 | ||||
| -rw-r--r-- | scss/utilities/_center-block.scss | 3 |
5 files changed, 13 insertions, 34 deletions
diff --git a/docs/components/utilities.md b/docs/components/utilities.md index 00bc96721..e59869fcd 100644 --- a/docs/components/utilities.md +++ b/docs/components/utilities.md @@ -60,8 +60,19 @@ Here are some representative examples of these classes: } {% endhighlight %} -Additionally, Bootstrap also includes an `.m-x-auto` class which sets the horizontal margins to `auto`. +Additionally, Bootstrap also includes an `.m-x-auto` class for 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);"> + Centered element + </div> +</div> + +{% highlight html %} +<div class="m-x-auto" style="width: 200px;""> + Centered element +</div> +{% endhighlight %} ## Text alignment @@ -191,27 +202,7 @@ Two similar non-responsive mixins (`pull-left` and `pull-right`) are also availa } {% endhighlight %} -## Center content - -Set an element to `display: block;` and center via `margin`. Available as a mixin and class. - -{% example html %} -<div class="center-block">Centered block</div> -{% endexample %} - -{% highlight scss %} -// Class -.center-block { - display: block; - margin-left: auto; - margin-right: auto; -} - -// Usage as a mixin -.element { - @include center-block; -} -{% endhighlight %} +## Clearfix Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes [the micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/) as popularized by Nicolas Gallagher. Can also be used as a mixin. diff --git a/scss/_mixins.scss b/scss/_mixins.scss index 934769fdc..5c8651207 100644 --- a/scss/_mixins.scss +++ b/scss/_mixins.scss @@ -48,7 +48,6 @@ // // Layout @import "mixins/clearfix"; -@import "mixins/center-block"; // @import "mixins/navbar-align"; @import "mixins/grid-framework"; @import "mixins/grid"; diff --git a/scss/_utilities.scss b/scss/_utilities.scss index ac703bc46..3f9e81f12 100644 --- a/scss/_utilities.scss +++ b/scss/_utilities.scss @@ -1,5 +1,4 @@ @import "utilities/background"; -@import "utilities/center-block"; @import "utilities/clearfix"; @import "utilities/pulls"; @import "utilities/screenreaders"; diff --git a/scss/mixins/_center-block.scss b/scss/mixins/_center-block.scss deleted file mode 100644 index e06fb5e27..000000000 --- a/scss/mixins/_center-block.scss +++ /dev/null @@ -1,7 +0,0 @@ -// Center-align a block level element - -@mixin center-block() { - display: block; - margin-left: auto; - margin-right: auto; -} diff --git a/scss/utilities/_center-block.scss b/scss/utilities/_center-block.scss deleted file mode 100644 index 0c986667a..000000000 --- a/scss/utilities/_center-block.scss +++ /dev/null @@ -1,3 +0,0 @@ -.center-block { - @include center-block(); -} |
