diff options
| author | Martijn Cuppens <[email protected]> | 2019-06-30 16:59:58 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-07-22 16:08:58 +0300 |
| commit | b4c422340905b59aa34a0e20ca707bc06ed11ad7 (patch) | |
| tree | 3cfc2cdf425485a1832f56721bfe04159f726088 /site/content/docs/4.3/components | |
| parent | 3b73dfc44badc90953cc3f4b239b679c9e46cd34 (diff) | |
| download | bootstrap-b4c422340905b59aa34a0e20ca707bc06ed11ad7.tar.xz bootstrap-b4c422340905b59aa34a0e20ca707bc06ed11ad7.zip | |
Remove card columns in favor of masonry grid
Diffstat (limited to 'site/content/docs/4.3/components')
| -rw-r--r-- | site/content/docs/4.3/components/card.md | 86 |
1 files changed, 2 insertions, 84 deletions
diff --git a/site/content/docs/4.3/components/card.md b/site/content/docs/4.3/components/card.md index 7860c5d76..99225ceec 100644 --- a/site/content/docs/4.3/components/card.md +++ b/site/content/docs/4.3/components/card.md @@ -601,88 +601,6 @@ Just like with card groups, card footers in decks will automatically line up. </div> {{< /example >}} -### Card columns +### Card columns (Masonry layout) -Cards can be organized into [Masonry](https://masonry.desandro.com/)-like columns with just CSS by wrapping them in `.card-columns`. Cards are built with CSS `column` properties instead of flexbox for easier alignment. Cards are ordered from top to bottom and left to right. - -**Heads up!** Your mileage with card columns may vary. To prevent cards breaking across columns, we must set them to `display: inline-block` as `column-break-inside: avoid` isn't a bulletproof solution yet. - -{{< example >}} -<div class="card-columns"> - <div class="card"> - {{< placeholder width="100%" height="160" class="card-img-top" text="Image cap" >}} - <div class="card-body"> - <h5 class="card-title">Card title that wraps to a new line</h5> - <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> - </div> - </div> - <div class="card p-3"> - <blockquote class="blockquote mb-0 card-body"> - <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> - <footer class="blockquote-footer"> - <small class="text-muted"> - Someone famous in <cite title="Source Title">Source Title</cite> - </small> - </footer> - </blockquote> - </div> - <div class="card"> - {{< placeholder width="100%" height="160" class="card-img-top" text="Image cap" >}} - <div class="card-body"> - <h5 class="card-title">Card title</h5> - <p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p> - <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> - </div> - </div> - <div class="card bg-primary text-white text-center p-3"> - <blockquote class="blockquote mb-0"> - <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p> - <footer class="blockquote-footer text-white"> - <small> - Someone famous in <cite title="Source Title">Source Title</cite> - </small> - </footer> - </blockquote> - </div> - <div class="card text-center"> - <div class="card-body"> - <h5 class="card-title">Card title</h5> - <p class="card-text">This card has a regular title and short paragraphy of text below it.</p> - <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> - </div> - </div> - <div class="card"> - {{< placeholder width="100%" height="260" class="card-img" text="Card image" >}} - </div> - <div class="card p-3 text-right"> - <blockquote class="blockquote mb-0"> - <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> - <footer class="blockquote-footer"> - <small class="text-muted"> - Someone famous in <cite title="Source Title">Source Title</cite> - </small> - </footer> - </blockquote> - </div> - <div class="card"> - <div class="card-body"> - <h5 class="card-title">Card title</h5> - <p class="card-text">This is another card with title and supporting text below. This card has some additional content to make it slightly taller overall.</p> - <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> - </div> - </div> -</div> -{{< /example >}} - -Card columns can also be extended and customized with some additional code. Shown below is an extension of the `.card-columns` class using the same CSS we use—CSS columns— to generate a set of responsive tiers for changing the number of columns. - -{{< highlight scss >}} -.card-columns { - @include media-breakpoint-only(lg) { - column-count: 4; - } - @include media-breakpoint-only(xl) { - column-count: 5; - } -} -{{< /highlight >}} +In `v4` we used a CSS-only technique to mimic the behaviour of [Masonry](https://masonry.desandro.com/)-like columns, but this technique came with lots of unpleasant [side effects](https://github.com/twbs/bootstrap/pull/28922). If you want to have this type of layout in `v5`, you can just make use of Masonry plugin. **Masonry is not included in Bootstrap**, but we've made a [demo example]({{< docsref "/examples/masonry" >}}) to help you get started. |
