Sha256: 5bc36f8b6451ac063d47c2c0b41c6f788407dd2a002aeb58b6271a869838509f

Contents?: true

Size: 1.04 KB

Versions: 118

Compression:

Stored size: 1.04 KB

Contents

// Image Mixins
// - Responsive image
// - Retina image


// 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
}


// Retina image
//
// Short retina mixin for setting background-image and -size. Note that the
// spelling of `min--moz-device-pixel-ratio` is intentional.
.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
  background-image: url("@{file-1x}");

  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and (     -o-min-device-pixel-ratio: 2/1),
  only screen and (        min-device-pixel-ratio: 2),
  only screen and (                min-resolution: 192dpi),
  only screen and (                min-resolution: 2dppx) {
    background-image: url("@{file-2x}");
    background-size: @width-1x @height-1x;
  }
}

Version data entries

118 entries across 118 versions & 24 rubygems

Version Path
twitter-bootstrap-rails-5.0.0 vendor/toolkit/twitter/bootstrap/mixins/image.less
card-1.97.0 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.8 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
sanskrit-documentation-theme-0.1.8 assets/node_modules/bootstrap/less/mixins/image.less
card-1.96.7 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.6 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.5 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.4 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.3 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.2 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.1 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.96.0 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.95.3 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.95.2 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.95.1 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
card-1.95.0 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
optimacms-0.3.35 node_modules/tinymce-dist/node_modules/bootstrap/less/mixins/image.less
optimacms-0.3.34 node_modules/tinymce-dist/node_modules/bootstrap/less/mixins/image.less
card-1.94.1 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/mixins/image.less
kms-1.2.1 vendor/assets/bower_components/bootstrap/less/mixins/image.less