diff --git a/src/scss/helpers/_image.scss b/src/scss/helpers/_image.scss new file mode 100644 index 0000000..b838216 --- /dev/null +++ b/src/scss/helpers/_image.scss @@ -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; +}