Permalink
Browse files

Updated sprite mixin

  • Loading branch information...
1 parent f353f1e commit 43d5f72b4ce109a9c42436cd3d2e456686206674 Tom Krush committed May 8, 2012
Showing with 15 additions and 9 deletions.
  1. +15 −9 _mixins.scss
View
@@ -5,14 +5,6 @@
#{$property}: $value;
}
-@mixin sprite($file, $row:1, $col:1, $width: 16px, $height: 16px)
-{
- width: $width;
- height: $height;
- background-position: $row * $width $col*$height;
- background-image: url($file);
-}
-
@mixin position($top: false, $left: false, $bottom: false, $right: false, $zindex: false) {
position: absolute;
@if type_of($top) == number {
@@ -109,7 +101,21 @@
@media (-webkit-min-device-pixel-ratio: 2) {
background-image: url('../images/' + $retina_name) !important;
- -webkit-background-size: $width $height;
+ @include experimental-property(-webkit, background-size, $width $height);
+ }
+}
+
+@mixin sprite($file, $type, $row:1, $col:1, $width: 16px, $height: 16px, $retina: false, $sprite_width: '', $sprite_height: '')
+{
+ width: $width;
+ height: $height;
+ background-position: $row * $width $col*$height;
+
+ @if $retina AND type_of($sprite_width) == 'number' AND type_of($sprite_height) == 'number' {
+ @include hires-graphic($file, $type, $sprite_width, $sprite_height);
+ }
+ @else {
+ background-image: url('../images/' + $file + '.' + $type);
}
}

0 comments on commit 43d5f72

Please sign in to comment.