diff --git a/frameworks/compass/stylesheets/compass/_utilities.sass b/frameworks/compass/stylesheets/compass/_utilities.sass index 4040ad3e..767001d5 100644 --- a/frameworks/compass/stylesheets/compass/_utilities.sass +++ b/frameworks/compass/stylesheets/compass/_utilities.sass @@ -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 diff --git a/frameworks/compass/stylesheets/compass/utilities/_sprites.sass b/frameworks/compass/stylesheets/compass/utilities/_sprites.sass new file mode 100644 index 00000000..48b42433 --- /dev/null +++ b/frameworks/compass/stylesheets/compass/utilities/_sprites.sass @@ -0,0 +1 @@ +@import sprites/sprite_img.sass \ No newline at end of file diff --git a/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass b/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass new file mode 100644 index 00000000..5d46a53a --- /dev/null +++ b/frameworks/compass/stylesheets/compass/utilities/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 \ No newline at end of file