diff options
| author | Chris Rebert <[email protected]> | 2015-11-10 23:28:02 -0800 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2015-11-10 23:28:02 -0800 |
| commit | cfd9c30eeddf7bd1dc4aeac1e7e7f2a595f5ca6e (patch) | |
| tree | a0967713e08eb5cd924901b5c432b3289116c913 | |
| parent | 91005397b35fda871d84274c67d263dfec08faa6 (diff) | |
| parent | be1232c5800a7d3f26c4b618a7d84f65f43a1b85 (diff) | |
| download | bootstrap-cfd9c30eeddf7bd1dc4aeac1e7e7f2a595f5ca6e.tar.xz bootstrap-cfd9c30eeddf7bd1dc4aeac1e7e7f2a595f5ca6e.zip | |
Merge pull request #18182 from twbs/img-fluid-doc
Add comments explaining why we don't make `<img>`s responsive by default
| -rw-r--r-- | scss/_images.scss | 6 | ||||
| -rw-r--r-- | scss/_reboot.scss | 2 |
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. } |
