Last active
August 29, 2015 14:11
-
-
Save Jhony0311/0ab998f8d37d829e4531 to your computer and use it in GitHub Desktop.
Compass sprite simple example
This file contains hidden or 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
// Reference: | |
// http://compass-style.org/help/tutorials/spriting/ | |
// http://compass-style.org/help/tutorials/spriting/customization-options/ | |
// Import Compass utility for sprites | |
@import 'compass/utilities/sprites'; | |
// Set spacing | |
$icon-sprite-spacing: 5px; | |
// Initialize sprite in a variable | |
// SYNTAXIS: sprite-map("route", $layout: -smart/horizontal/vertical-, $dimensions: -true/false-); | |
$icon-sprite: sprite-map("icons/*.png", $layout: smart, $dimensions: true); | |
//Usage | |
// SYNTAXIS: background: sprite($sprite-variable, asset-without-extension); | |
.icon { | |
background: sprite($icon-sprite, get-tickets-btn); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment