diff --git a/scss/_card.scss b/scss/_card.scss index f68855c56c..9385859262 100644 --- a/scss/_card.scss +++ b/scss/_card.scss @@ -175,6 +175,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/content/docs/4.3/components/card.md b/site/content/docs/4.3/components/card.md index a3b64dc571..4f789fc6fd 100644 --- a/site/content/docs/4.3/components/card.md +++ b/site/content/docs/4.3/components/card.md @@ -601,6 +601,92 @@ Just like with card groups, card footers in decks will automatically line up. {{< /example >}} -### Card columns (Masonry layout) +### 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. + +{{< 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.
+