Permalink
Browse files

adding files

  • Loading branch information...
1 parent 6ba4c66 commit df7a3654a9eddc6453baf9fea0c3697fcd1b2415 @this-chris committed Mar 28, 2013
Showing with 39 additions and 0 deletions.
  1. +5 −0 README.md
  2. +26 −0 mixins.css.sass
  3. +8 −0 sprites.css.sass
View
@@ -2,3 +2,8 @@ Compass Retina and Normal Sprite Mixin
======================================
Syntax: SASS :-)
+
+Usage:
+======
+
++icons-sprite(icon_name)
View
@@ -0,0 +1,26 @@
+// ****************************************************************
+// * @file mxixins
+// * @description usage for all sprites
+// ****************************************************************
+=icons-sprite($name, $x: 0, $y: 0)
+ +retina-sprite($name, $x, $y, $sprites, $sprites2x)
+
+
+=retina-sprite($name, $x, $y, $sprites, $sprites2x, $dimensions: true, $padding: 0)
+ @if $dimensions == true
+ +sprite-dimensions($sprites, $name)
+
+ background-image: sprite-url($sprites)
+ background-position: sprite-position($sprites, $name, $x, $y)
+ background-repeat: no-repeat
+
+ @if $padding > 0
+ padding: $padding
+
+ @media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5)
+ &
+ $position: sprite-position($sprites2x, $name, $x, $y)
+ background-image: sprite-url($sprites2x)
+ background-position: nth($position, 1) nth($position, 2)/2
+ $background_size: ceil(image-width(sprite-path($sprites2x)) / 2) / 1
+ +background-size($background_size auto)
View
@@ -0,0 +1,8 @@
+// ****************************************************************
+// * @file Sprites
+// * @description manage here your sprites
+// ****************************************************************
+@import compass/utilities/sprites/base
+
+$sprites: sprite-map("icons/*.png", $spacing: 20px)
+$sprites2x: sprite-map("icons2x/*.png", $spacing: 40px)

0 comments on commit df7a365

Please sign in to comment.