diff --git a/scss/_card.scss b/scss/_card.scss index fdbe95f404..5cca2ae283 100644 --- a/scss/_card.scss +++ b/scss/_card.scss @@ -168,6 +168,18 @@ } } +$row-columns: 6 !default; + +@each $breakpoint in map-keys($grid-breakpoints) { + $infix: breakpoint-infix($breakpoint, $grid-breakpoints); + + @for $i from 1 through $row-columns { + .row-cols#{$infix}-#{$i} > [class^="col"] { + flex: 0 0 calc(100% / #{$i}); + } + } +} + // // Card groups diff --git a/site/docs/4.3/components/card.md b/site/docs/4.3/components/card.md index fa9c6ffc15..7d04f45161 100644 --- a/site/docs/4.3/components/card.md +++ b/site/docs/4.3/components/card.md @@ -621,6 +621,94 @@ Just like with card groups, card footers in decks will automatically line up. {% endcapture %} {% include example.html content=example %} +### Grid cards + +Use the Bootstrap grid system and its [`.rol-cols` classes]() to control how many grid columns (wrapped around your cards) you show per row. + +{% capture example %} +
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
+This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
+This is a longer card with supporting text below as a natural lead-in to additional content.
+This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
+This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
+This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
+This is a longer card with supporting text below as a natural lead-in to additional content.
+This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
+