aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-10-09 14:14:39 -0700
committerMark Otto <[email protected]>2016-10-09 14:14:39 -0700
commit88bf5af896a872d65752956e85adb66a9192e697 (patch)
tree0df3e8d7436708bc4fa6e4790aa326f92b45132f
parent3dc4b3647ce2b27b0216fe8103253ffe9633fde9 (diff)
downloadbootstrap-88bf5af896a872d65752956e85adb66a9192e697.tar.xz
bootstrap-88bf5af896a872d65752956e85adb66a9192e697.zip
Remove display from the .img-fluid utility
Creating max-width images is not dependent on the display, so setting it is redundant. Cleans up the comments and implementation of the mixin as well. Fixes #20767
-rw-r--r--scss/_images.scss4
-rw-r--r--scss/mixins/_image.scss10
2 files changed, 8 insertions, 6 deletions
diff --git a/scss/_images.scss b/scss/_images.scss
index 3ca811ecd..3cdedc4ff 100644
--- a/scss/_images.scss
+++ b/scss/_images.scss
@@ -6,7 +6,7 @@
// which weren't expecting the images within themselves to be involuntarily resized.
// See also https://github.com/twbs/bootstrap/issues/18178
.img-fluid {
- @include img-fluid();
+ @include img-fluid;
}
@@ -20,7 +20,7 @@
@include box-shadow($thumbnail-box-shadow);
// Keep them at most 100% wide
- @include img-fluid(inline-block);
+ @include img-fluid;
}
//
diff --git a/scss/mixins/_image.scss b/scss/mixins/_image.scss
index 91d2f59ee..c2b45f2ce 100644
--- a/scss/mixins/_image.scss
+++ b/scss/mixins/_image.scss
@@ -7,10 +7,12 @@
//
// Keep images from scaling beyond the width of their parents.
-@mixin img-fluid($display: block) {
- display: $display;
- max-width: 100%; // Part 1: Set a maximum relative to the parent
- height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
+@mixin img-fluid {
+ // Part 1: Set a maximum relative to the parent
+ max-width: 100%;
+ // Part 2: Override the height to auto, otherwise images will be stretched
+ // when setting a width and height attribute on the img element.
+ height: auto;
}