Skip to content
Browse files

Added optional retina-filename

  • Loading branch information...
1 parent 58fa7d4 commit dc50484f94ad5746916bec4b3f29d143445978f6 Phil LaPier committed
Showing with 11 additions and 3 deletions.
  1. +11 −3 app/assets/stylesheets/addons/_retina-image.scss
View
14 app/assets/stylesheets/addons/_retina-image.scss
@@ -1,4 +1,4 @@
-@mixin retina-image($filename, $image-width, $image-height, $extension: ".png") {
+@mixin retina-image($filename, $image-width, $image-height, $extension: ".png", $retina-filename: null) {
background-image: url($filename + $extension);
height: $image-height;
width: $image-width;
@@ -7,8 +7,16 @@
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
- (min-resolution: 1.3dppx) {
- background-image: url($filename + "@2x" + $extension);
+ (min-resolution: 1.3dppx) {
+
+ @if $retina-filename {
+ background-image: url($retina-filename + "@2x" + $extension);
+ }
+ @else {
+ background-image: url($filename + "@2x" + $extension);
+ }
+
background-size: $image-width $image-height;
+
}
}

0 comments on commit dc50484

Please sign in to comment.
Something went wrong with that request. Please try again.