Last active
August 29, 2015 13:56
-
-
Save 4lun/9230692 to your computer and use it in GitHub Desktop.
Auto generate icon sprite and classes from icon/ directory. Resulting icons will be have .i-<filename> classes. Needs to be placed on an i element or on an element that includes the .i class
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
@import "compass/utilities/sprites"; | |
$icon: sprite-map("icon/*.png", $layout: smart); | |
i, .i { | |
display: inline-block; | |
vertical-align: middle; | |
background-repeat: no-repeat; | |
background-position: top left; | |
background-image: $icon; | |
.lt-ie8 & { | |
display: inline; | |
} | |
} | |
@each $i in sprite_names($icon){ | |
.i-#{$i}{ | |
@include sprite-dimensions($icon, $i); | |
background-position: sprite-position($icon, $i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment