Skip to content

Instantly share code, notes, and snippets.

View scottgallant's full-sized avatar

Scott Gallant scottgallant

View GitHub Profile
@hugeuser
hugeuser / Usage
Created February 27, 2014 19:09
Usage
//normal desktop icon
@include get-sprite( $sprites-sprites, icon );
//2x dpi mobile icon
@include get-sprite( $sprites_x2-sprites, icon, true, 0, 1 );
@hugeuser
hugeuser / Sprite Map Mixin
Last active August 29, 2015 13:56
adjustment options
$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.
@thulstrup
thulstrup / compass-retina-sprites.scss
Created March 20, 2012 19:18
Using Compass to generate normal and retina sprite maps
$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));