_retina-image.scss 845 B

12345678910111213141516171819202122232425262728293031
  1. @mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: false) {
  2. @if $asset-pipeline {
  3. background-image: image-url("#{$filename}.#{$extension}");
  4. }
  5. @else {
  6. background-image: url("#{$filename}.#{$extension}");
  7. }
  8. @include hidpi {
  9. @if $asset-pipeline {
  10. @if $retina-filename {
  11. background-image: image-url("#{$retina-filename}.#{$extension}");
  12. }
  13. @else {
  14. background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}");
  15. }
  16. }
  17. @else {
  18. @if $retina-filename {
  19. background-image: url("#{$retina-filename}.#{$extension}");
  20. }
  21. @else {
  22. background-image: url("#{$filename}#{$retina-suffix}.#{$extension}");
  23. }
  24. }
  25. background-size: $background-size;
  26. }
  27. }