aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-07-23 20:51:21 -0700
committerGitHub <[email protected]>2016-07-23 20:51:21 -0700
commited9977c4640472e77155a214b97dacca0907029b (patch)
tree059a66cde90463a3e102cba90f153def9b72208c /docs
parent2ab662095b285dc6a8947676c9e38e630620fc80 (diff)
parentb36e6dae2ffde905db2cdc6f7b4f987e2bd4bd75 (diff)
downloadbootstrap-ed9977c4640472e77155a214b97dacca0907029b.tar.xz
bootstrap-ed9977c4640472e77155a214b97dacca0907029b.zip
Merge pull request #20349 from twbs/v4-grid-fixes
v4: Follow-up grid fixes
Diffstat (limited to 'docs')
-rw-r--r--docs/layout/grid.md32
1 files changed, 17 insertions, 15 deletions
diff --git a/docs/layout/grid.md b/docs/layout/grid.md
index b93f0d8b7..8e7c5225e 100644
--- a/docs/layout/grid.md
+++ b/docs/layout/grid.md
@@ -180,20 +180,21 @@ Mixins are used in conjunction with the grid variables to generate semantic CSS
}
// Make the element grid-ready (applying everything but the width)
-@mixin make-col($gutter: $grid-gutter-width) {
+@mixin make-col-ready($size, $columns: $grid-columns, $gutter: $grid-gutter-width) {
position: relative;
+ min-height: 1px; // Prevent collapsing
+ padding-right: ($gutter / 2);
+ padding-left: ($gutter / 2);
+
+ // Prevent columns from becoming too narrow when at smaller grid tiers by
+ // always setting `width: 100%;`. This works because we use `flex` values
+ // later on to override this initial width.
@if $enable-flex {
- flex: 1;
- } @else {
- float: left;
+ width: 100%;
}
- min-height: 1px;
- padding-left: ($gutter / 2);
- padding-right: ($gutter / 2);
}
-@mixin make-col-span($size, $columns: $grid-columns) {
- // Set a width (to be used in or out of media queries)
+@mixin make-col($size, $columns: $grid-columns, $gutter: $grid-gutter-width) {
@if $enable-flex {
flex: 0 0 percentage($size / $columns);
// Add a `max-width` to ensure content within each column does not blow out
@@ -201,6 +202,7 @@ Mixins are used in conjunction with the grid variables to generate semantic CSS
// do not appear to require this.
max-width: percentage($size / $columns);
} @else {
+ float: left;
width: percentage($size / $columns);
}
}
@@ -232,23 +234,23 @@ See it in action in <a href="http://jsbin.com/ruxona/edit">this rendered example
@include make-row();
}
.content-main {
- @include make-col();
+ @include make-col-ready();
@media (max-width: 32em) {
- @include make-col-span(6);
+ @include make-col(6);
}
@media (min-width: 32.1em) {
- @include make-col-span(8);
+ @include make-col(8);
}
}
.content-secondary {
- @include make-col();
+ @include make-col-ready();
@media (max-width: 32em) {
- @include make-col-span(6);
+ @include make-col(6);
}
@media (min-width: 32.1em) {
- @include make-col-span(4);
+ @include make-col(4);
}
}
{% endhighlight %}