1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-11 16:14:04 +02:00

fixes #9582: restore img-responsive as a class and move it's mixin to mixins.less

This commit is contained in:
Mark Otto
2013-08-15 00:46:18 -07:00
parent 1b6a5bbca2
commit fee3f1e733
4 changed files with 26 additions and 11 deletions

View File

@@ -344,6 +344,12 @@ img {
vertical-align: middle; vertical-align: middle;
} }
.img-responsive {
display: block;
height: auto;
max-width: 100%;
}
.img-rounded { .img-rounded {
border-radius: 6px; border-radius: 6px;
} }

File diff suppressed because one or more lines are too long

View File

@@ -294,10 +294,10 @@
// RETINA IMAGE SUPPORT // Retina images
// -------------------------------------------------- //
// Short retina mixin for setting background-image and -size // Short retina mixin for setting background-image and -size
.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
background-image: url("@{file-1x}"); background-image: url("@{file-1x}");
@@ -314,6 +314,17 @@
} }
// Responsive image
//
// Keep images from scaling beyond the width of their parents.
.img-responsive(@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
}
// COMPONENT MIXINS // COMPONENT MIXINS
// -------------------------------------------------- // --------------------------------------------------

View File

@@ -73,10 +73,8 @@ img {
} }
// Responsive images (ensure images don't scale beyond their parents) // Responsive images (ensure images don't scale beyond their parents)
.img-responsive(@display: block;) { .img-responsive {
display: @display; .img-responsive();
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
} }
// Rounded corners // Rounded corners