aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Cuppens <[email protected]>2019-10-03 09:21:40 +0200
committerGitHub <[email protected]>2019-10-03 09:21:40 +0200
commit03c9788f7a0293beef328c004b124f4433c3c64d (patch)
treea0ff43603def84a779d54c426d9cb1d924a9f1c0
parentf6a1e2fc8990f2c8975b0f27fc14027a6f7e9fae (diff)
downloadbootstrap-03c9788f7a0293beef328c004b124f4433c3c64d.tar.xz
bootstrap-03c9788f7a0293beef328c004b124f4433c3c64d.zip
Variable card height (#29462)
-rw-r--r--scss/_card.scss1
-rw-r--r--scss/_variables.scss1
-rw-r--r--site/content/docs/4.3/components/card.md2
3 files changed, 3 insertions, 1 deletions
diff --git a/scss/_card.scss b/scss/_card.scss
index c4d046ca0..d055ca310 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 a5da4e41d..0e7626beb 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 6296c2eeb..94abe9185 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.
</div>
{{< /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 >}}
<div class="row row-cols-1 row-cols-md-3">