mixtur / webpack-spritesmith

Webpack plugin that converts set of images into a spritesheet and SASS/LESS/Stylus mixins
499 stars 56 forks source link

How to support '@3' retina? #81

Open wind4gis opened 5 years ago

wind4gis commented 5 years ago

Excuse me, How to support '@3' retina and '@2' at the same time?

mixtur commented 5 years ago

I don't think it is possible with this plugin. It is modeled after gulp-spritesmith and it doesn't seem to support that. It will require different compilation strategy and different api templates. Now it is hard coded to either create spritesheet from one set of images or two spritesheets from two sets of images. And api templates I am using are also assuming either one or two sets of images.

wind4gis commented 5 years ago

@mixtur can I use node-glob, and I put @1 @2 @3 three type of picture into three folder, just new three plugin to support?

mixtur commented 5 years ago

You can create three instances of plugin, yes. It will produce three different spritesheets, depeding on how you configure each instance, but it will also produce three APIs. If you want them to cooperate you'll have to do this coordination yourself.