[Compass Core] Initial css-sprite implementation.
This commit is contained in:
parent
4533a00085
commit
1f21d63091
@ -1,5 +1,6 @@
|
|||||||
@import utilities/general.sass
|
@import utilities/general.sass
|
||||||
@import utilities/links.sass
|
@import utilities/links.sass
|
||||||
@import utilities/lists.sass
|
@import utilities/lists.sass
|
||||||
|
@import utilities/sprites.sass
|
||||||
@import utilities/tables.sass
|
@import utilities/tables.sass
|
||||||
@import utilities/text.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
|
Loading…
Reference in New Issue
Block a user