This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sprites: sprite-map("sprites/*.png"); | |
$sprites-retina: sprite-map("sprites-retina/*.png"); | |
@mixin sprite-background($name) { | |
background-image: sprite-url($sprites); | |
background-position: sprite-position($sprites, $name); | |
background-repeat: no-repeat; | |
display: block; | |
height: image-height(sprite-file($sprites, $name)); | |
width: image-width(sprite-file($sprites, $name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sprites-spacing: 2px; | |
@import "sprites/*.png"; | |
//this will create a variable named $sprites-sprites | |
$sprites_x2-spacing: 4px; | |
@import "sprites_x2/*.png"; | |
//this will create a variable named $sprites_x2-sprites | |
@mixin get-sprite( $map, $sprite, $x2: false, $adjustX: 0, $adjustY: 0, $repeat: no-repeat ){ | |
//For use in media queries. Regular @import <dir>-sprite(file-name) does not fully work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//normal desktop icon | |
@include get-sprite( $sprites-sprites, icon ); | |
//2x dpi mobile icon | |
@include get-sprite( $sprites_x2-sprites, icon, true, 0, 1 ); |