mixtur / webpack-spritesmith

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

Retina Sprites #3

Closed jbrialon closed 8 years ago

jbrialon commented 8 years ago

Hello,

how could I configure webpack-spritesmith to generate retina sprites ? (@2x) I can't figure how to pass the right parameters

thanks in advance

mixtur commented 8 years ago

I believe you currently can't. I'll investigate the way retina sprites are handled in spritesheet-templates in nearest few days and implement this feature then.

jbrialon commented 8 years ago

thanks :+1:

mixtur commented 8 years ago

I think I implemented it. I will not publish for a few more days just in case if I ocasionally broke something in process. It is not really tested yet. But you can try it with npm i github:mixtur/webpack-spritesmith#retina. To enable retina mode just add retina: '@2x' to config.

jbrialon commented 8 years ago

I just tried and it seems to work fine, I let you now if I encounter some issues

thanks a lot !

alettieri commented 8 years ago

+1 This is great

mixtur commented 8 years ago

published to npm

alettieri commented 8 years ago

@mixtur great!

bennam commented 7 years ago

Will this support '@3x'?

mixtur commented 7 years ago

@bennam There is a problem with that. webpack-spritesmith works in two steps. Generating spritesheet image and generating API in SASS/LESS/etc.

So I can generate any number of spritesheets by some criterion. But when generarating API I rely on this library https://github.com/twolfson/spritesheet-templates and it only support 1x and 2x sprites.