From 742e3a79dd2c7ee9eb2d459bc0de176ce3110e5f Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 3 Oct 2017 16:10:54 -0700 Subject: [PATCH] Update column resets docs to include new section for column breaks - Moves offset reset to the offset section - Adds new breaks section to fix #24136 --- docs/4.0/layout/grid.md | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/docs/4.0/layout/grid.md b/docs/4.0/layout/grid.md index a194bd8401..ca608477b4 100644 --- a/docs/4.0/layout/grid.md +++ b/docs/4.0/layout/grid.md @@ -476,9 +476,9 @@ If more than 12 columns are placed within a single row, each group of extra colu {% endexample %} -### Column resets +### Column breaks -With the handful of grid tiers available, you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a `.clearfix` and our [responsive display utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/). +Breaking columns to a new line in flexbox requires a small hack: add an element with `width: 100%` wherever you want to wrap your columns to a new line. Normally this is accomplished with multiple `.row`s, but not ever implementation method can account for this.
{% example html %} @@ -486,8 +486,8 @@ With the handful of grid tiers available, you're bound to run into issues where,
.col-6 .col-sm-3
.col-6 .col-sm-3
- -
+ +
.col-6 .col-sm-3
.col-6 .col-sm-3
@@ -495,18 +495,19 @@ With the handful of grid tiers available, you're bound to run into issues where, {% endexample %}
-In addition to column clearing at responsive breakpoints, you may need to reset offsets. See this in action in [the grid example]({{ site.baseurl }}/docs/{{ site.docs_version }}/examples/grid/). +You may also apply this break at specific breakpoints with our [responsive display utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/).
{% example html %}
-
.col-sm-5 .col-md-6
-
.col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0
-
+
.col-6 .col-sm-4
+
.col-6 .col-sm-4
-
-
.col.col-sm-6.col-md-5.col-lg-6
-
.col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0
+ +
+ +
.col-6 .col-sm-4
+
.col-6 .col-sm-4
{% endexample %}
@@ -579,6 +580,22 @@ Move columns to the right using `.offset-md-*` classes. These classes increase t {% endexample %} +In addition to column clearing at responsive breakpoints, you may need to reset offsets. See this in action in [the grid example]({{ site.baseurl }}/docs/{{ site.docs_version }}/examples/grid/). + +
+{% example html %} +
+
.col-sm-5 .col-md-6
+
.col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0
+
+ +
+
.col.col-sm-6.col-md-5.col-lg-6
+
.col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0
+
+{% endexample %} +
+ #### Margin utilities With the move to flexbox in v4, you can use margin utilities like `.mr-auto` to force sibling columns away from one another.