add img-fluid helper
Responsive images (ensure images don't scale beyond their parents)
This commit is contained in:
parent
8f3b53f5d2
commit
18550e0d1f
|
@ -0,0 +1,13 @@
|
||||||
|
// Image Mixins
|
||||||
|
|
||||||
|
// Responsive image
|
||||||
|
//
|
||||||
|
// Keep images from scaling beyond the width of their parents.
|
||||||
|
// Solution provided by Twitter Bootstrap https://github.com/twbs/bootstrap/commit/88bf5af896a872d65752956e85adb66a9192e697#diff-74a54d296e5e8ef9f54d15fe3330778f63536c312545c97c169b4fd213fe93a5
|
||||||
|
@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;
|
||||||
|
}
|
Reference in New Issue