twolfson / gulp.spritesmith

Convert a set of images into a spritesheet and CSS variables via gulp
The Unlicense
1.08k stars 81 forks source link

Extend `cssSpritesheetName` to retina vars #70

Closed Antonio-Laguna closed 9 years ago

Antonio-Laguna commented 9 years ago

Hi here!

I've just set up this awesome gulp task and realised that, to be able to use several sprites (for whatever reason), the only thing missing would be to extend cssSpritesheetName usage to retina vars. For example:

$retina-spritesheet-width, $retina-spritesheet or $retina-groups should be "prefixed" somehow to include what's given in that var, otherwise it can cause errors since there will be repeating vars.

Thoughts on this?

twolfson commented 9 years ago

Hi there!

We provide cssRetinaSpritesheetName as the cssSpritesheetName equivalent. Sorry if it wasn't apparent at first, there are so many options to document x_x.

More info on cssRetinaSpritesheetName can be found under the "Retina parameters" section in the README:

https://github.com/twolfson/gulp.spritesmith/tree/4.1.1#retina-parameters

As you would expect, we use that variable like cssSpritesheetName for prefixing our retina spritesheet variables:

https://github.com/twolfson/spritesheet-templates/blob/10.0.0/lib/templates/scss_retina.template.handlebars#L24-L28

https://github.com/twolfson/spritesheet-templates/blob/10.0.0/test/expected_files/scss_retina.scss#L85-L89