From 03c9788f7a0293beef328c004b124f4433c3c64d Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Thu, 3 Oct 2019 09:21:40 +0200 Subject: [PATCH] Variable card height (#29462) --- scss/_card.scss | 1 + scss/_variables.scss | 1 + site/content/docs/4.3/components/card.md | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scss/_card.scss b/scss/_card.scss index c4d046ca0a..d055ca3101 100644 --- a/scss/_card.scss +++ b/scss/_card.scss @@ -7,6 +7,7 @@ display: flex; flex-direction: column; min-width: 0; // See https://github.com/twbs/bootstrap/pull/22740#issuecomment-305868106 + height: $card-height; word-wrap: break-word; background-color: $card-bg; background-clip: border-box; diff --git a/scss/_variables.scss b/scss/_variables.scss index a5da4e41d5..0e7626beb0 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -840,6 +840,7 @@ $card-border-color: rgba($black, .125) !default; $card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default; $card-cap-bg: rgba($black, .03) !default; $card-cap-color: null !default; +$card-height: null !default; $card-color: null !default; $card-bg: $white !default; diff --git a/site/content/docs/4.3/components/card.md b/site/content/docs/4.3/components/card.md index 6296c2eeb7..94abe91856 100644 --- a/site/content/docs/4.3/components/card.md +++ b/site/content/docs/4.3/components/card.md @@ -689,7 +689,7 @@ Change it to `.row-cols-3` and you'll see the fourth card wrap. {{< /example >}} -When you need equal height, add `.h-100` to the cards. +When you need equal height, add `.h-100` to the cards. If you want equal heights by default, you can set `$card-height: 100%` in Sass. {{< example >}}