Permalink
Browse files

[Compass Core] Initial css-sprite implementation.

  • Loading branch information...
tdreyno authored and chriseppstein committed May 15, 2009
1 parent 4533a00 commit 1f21d6309140c009188d350ed911eed5d34bf02e
@@ -1,5 +1,6 @@
@import utilities/general.sass
@import utilities/links.sass
@import utilities/lists.sass
@import utilities/sprites.sass
@import utilities/tables.sass
@import utilities/text.sass
@@ -0,0 +1 @@
@import sprites/sprite_img.sass
@@ -0,0 +1,12 @@
!sprite_image_default_width ||= 32px
!sprite_image_default_height ||= 32px
!sprite_image_default_margin ||= 0px
// Simplest use: +sprite-img("icons-32.png", 1)
=sprite-img(!img, !col, !row = 1, !width = !sprite_image_default_width, !height = !sprite_image_default_height, !margin = !sprite_image_default_margin)
!x = ((!col - 1) * -!height) - ((!col - 1) * !margin)
!y = ((!row - 1) * -!width) - ((!row - 1) * !margin)
:background= image_url(!img) "no-repeat" !x !y
:width= !width
:height= !height
:overflow hidden

0 comments on commit 1f21d63

Please sign in to comment.