Uses gulp.spritesmith. Grabs a folder of images and turns them into a sprite, creates a Sass mixin and class for each based on filename.

A documentation for SCSS features is available here.

Usage

Given a file named facebook.png, you can use this Sass mixin:

@include sprite('sprite-facebook');

Or this HTML class:

<span class="sprite-facebook"></span>

Retina Display support

You can generate a second sprite for Retina Display. First, you need to duplicates all your images and append "@2x" in the filename. For example: "facebook.png" and "facebook@2x.png".

After enabled it, you can now use the mixin:

@include retina-sprite('sprite-facebook');

It will automatically take sprite@2x for Retina Display, and normal sprite for others.

Commands

Config