You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

35 lines
1.0 KiB

  1. // Image Mixins
  2. // - Responsive image
  3. // - Retina image
  4. // Responsive image
  5. //
  6. // Keep images from scaling beyond the width of their parents.
  7. @mixin img-fluid($display: block) {
  8. display: $display;
  9. max-width: 100%; // Part 1: Set a maximum relative to the parent
  10. height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
  11. }
  12. // Retina image
  13. //
  14. // Short retina mixin for setting background-image and -size.
  15. @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
  16. background-image: url($file-1x);
  17. // Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio,
  18. // but doesn't convert dppx=>dpi.
  19. // There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.
  20. // Compatibility info: http://caniuse.com/#feat=css-media-resolution
  21. @media
  22. only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
  23. only screen and (min-resolution: 2dppx) { // Standardized
  24. background-image: url($file-2x);
  25. background-size: $width-1x $height-1x;
  26. }
  27. }