aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-11-05 13:18:42 -0800
committerChris Rebert <[email protected]>2015-11-05 13:18:42 -0800
commitbe1232c5800a7d3f26c4b618a7d84f65f43a1b85 (patch)
tree02cab35342a869b9304c5a9ef2ae7807b4419c14
parent4d17a04a2766315299de7e6f5d0894bb9ed25228 (diff)
downloadbootstrap-be1232c5800a7d3f26c4b618a7d84f65f43a1b85.tar.xz
bootstrap-be1232c5800a7d3f26c4b618a7d84f65f43a1b85.zip
Add comments explaining why we don't make `<img>`s responsive by default
Refs #18178 [ci skip]
-rw-r--r--scss/_images.scss6
-rw-r--r--scss/_reboot.scss2
2 files changed, 8 insertions, 0 deletions
diff --git a/scss/_images.scss b/scss/_images.scss
index eb7b4ce18..4f1ce6507 100644
--- a/scss/_images.scss
+++ b/scss/_images.scss
@@ -1,4 +1,10 @@
// Responsive images (ensure images don't scale beyond their parents)
+//
+// This is purposefully opt-in via an explicit class rather than being the default for all `<img>`s.
+// We previously tried the "images are responsive by default" approach in Bootstrap v2,
+// and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps)
+// 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();
}
diff --git a/scss/_reboot.scss b/scss/_reboot.scss
index 7c5278519..0da7e5ea6 100644
--- a/scss/_reboot.scss
+++ b/scss/_reboot.scss
@@ -191,6 +191,8 @@ img {
// By default, `<img>`s are `inline-block`. This assumes that, and vertically
// centers them. This won't apply should you reset them to `block` level.
vertical-align: middle;
+ // Note: `<img>`s are deliberately not made responsive by default.
+ // For the rationale behind this, see the comments on the `.img-fluid` class.
}