Permalink
Browse files

Use replace to add @2x to path string

  • Loading branch information...
1 parent 250d6ab commit 4de6ec55b2449b1214aaa3504efeb56407d4fbc5 @harrison harrison committed Aug 10, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/retina.less
View
@@ -5,10 +5,10 @@
.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 @highdpi {
background-image: url(@at2x_path);
background-size: @w @h;
- }
+ }
}

0 comments on commit 4de6ec5

Please sign in to comment.