Skip to content

Commit

Permalink
Add row-cols-auto and responsive variants
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnCuppens committed Jan 12, 2020
1 parent 1abcd61 commit 525327a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scss/mixins/_grid-framework.scss
Expand Up @@ -14,6 +14,10 @@
flex: 1 0 0%;
}

.row-cols#{$infix}-auto > * {
@include make-col-auto();
}

@for $i from 1 through $grid-row-columns {
.row-cols#{$infix}-#{$i} {
@include row-cols($i);
Expand Down
13 changes: 12 additions & 1 deletion site/content/docs/4.3/layout/grid.md
Expand Up @@ -298,7 +298,7 @@ Don't want your columns to simply stack in some grid tiers? Use a combination of

### Row columns

Use the responsive `.row-cols-*` classes to quickly set the number of columns that best render your content and layout. Whereas normal `.col-*` classes apply to the individual columns (e.g., `.col-md-4`), the row columns classes are set on the parent `.row` as a shortcut.
Use the responsive `.row-cols-*` classes to quickly set the number of columns that best render your content and layout. Whereas normal `.col-*` classes apply to the individual columns (e.g., `.col-md-4`), the row columns classes are set on the parent `.row` as a shortcut. With `.row-cols-auto` you can give the columns their natural width.

Use these row columns classes to quickly create basic grid layouts or to control your card layouts.

Expand All @@ -324,6 +324,17 @@ Use these row columns classes to quickly create basic grid layouts or to control
</div>
{{< /example >}}

{{< example class="bd-example-row" >}}
<div class="container">
<div class="row row-cols-auto">
<div class="col">Column</div>
<div class="col">Column</div>
<div class="col">Column</div>
<div class="col">Column</div>
</div>
</div>
{{< /example >}}

{{< example class="bd-example-row" >}}
<div class="container">
<div class="row row-cols-4">
Expand Down

0 comments on commit 525327a

Please sign in to comment.