twolfson / gulp.spritesmith

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

CSS Template #1

Closed jonathanrdelgado closed 10 years ago

jonathanrdelgado commented 10 years ago

Would you be opposed to a PR that added an option to utilize json2css.addMustacheTemplate?

We have a retina sprite that requires some special options.

twolfson commented 10 years ago

I am not sure why you closed this issue but to answer your question: No, I am not opposed to it.

Ideally, this would mimic the behavior of cssTemplate from grunt-spritsmith

https://github.com/Ensighten/grunt-spritesmith/tree/1.22.0#csstemplate https://github.com/Ensighten/grunt-spritesmith/blob/1.22.0/src/grunt-spritesmith.js#L130-L146

I left it out of the initial port due to thoughts about this scenario being a separate pipe flow with spritesmith itself. However, that does not seem like a low hanging fruit and would touch a lot of repos.

jonathanrdelgado commented 10 years ago

@twolfson Closed because this can be accomplished through post-processing. :)

Thanks!

twolfson commented 10 years ago

Ah, very nice. Can you provide an example of what you did? I was scared that a string would be too brittle so I am interested.

twolfson commented 10 years ago

For reference, we have added cssTemplate support via #3. It was released in 0.2.0.

jonathanrdelgado commented 10 years ago

@twolfson Sorry for not responding on this, I guess I dismissed the notification accidentally.

I just did a regex and templated the data.

Glad to see this is a feature now, though.

twolfson commented 9 years ago

As a heads up, gulp.spritesmith@3.5.0 now supports retina spritesheets. More information can be found here:

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

https://github.com/twolfson/gulp.spritesmith#retina-spritesheet