Permalink
Browse files

Merge branch 'master' of git://github.com/Harrison/retinajs into Harr…

…ison-master
  • Loading branch information...
2 parents d5944fe + 4de6ec5 commit fe791bce405a2734ccfea78367282479ac8fb86b Casey O'Hara committed Aug 18, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/retina.less
View
@@ -1,12 +1,14 @@
// retina.less
// A helper mixin for applying high-resolution background images (http://www.retinajs.com)
+@highdpi: ~"(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";
+
.at2x(@path, @w: auto, @h: auto) {
background-image: url(@path);
- @at2x_path: ~`"@{path}".split('.').slice(0, "@{path}".split('.').length - 1).join(".") + "@2x" + "." + "@{path}".split('.')["@{path}".split('.').length - 1]`;
+ @at2x_path: ~`"@{path}".replace(/\.\w+$/, function(match) { return "@2x" + match; })`;
- @media all and (-webkit-min-device-pixel-ratio : 1.5) {
+ @media @highdpi {
background-image: url(@at2x_path);
background-size: @w @h;
- }
+ }
}

0 comments on commit fe791bc

Please sign in to comment.