images go in, sprites come out
spritestream reads from a stream of retina and non-retina image files and spits out sprite sheets and an accompanying CSS file. It is designed for use with Gulp.
Pipe your source files into
spritestream, and provide a callback. The callback
will receive either an error or an array of results with the non-retina sprite
image, the retina sprite image, and the CSS file, in that order.
spritestream assumes that for each
image.png, there is an accompanying
firstname.lastname@example.org for use in the retina sprite sheet.
var es = ;var gulp = ;var spritestream = ;gulp;
Use a custom CSS class. By default, classes will be named like
.icon-image-name. These can be changed to
for example, by passing
true to append an md5 hash of the file contents to the end of its name.
The path, relative to the ultimate pipe destination, to attach to the image Vinyl file objects.
The path, relative to the ultimate pipe destination, to attach to the CSS Vinyl file objects.
Provide a template to use other than the default one. This will be compiled with
EJS. See the existing template in
templates/sprites.css.ejs for an example.
Can be a string or a Buffer.
This example will result in the following files:
npm install spritestream --save
npm run test-server