Closed niksy closed 7 years ago
I think that will be a nice addition to the plugin. Can you make a PR for this one?
Sure, will get on it as soon as possible!
@vvasilev- I’ve made the PR https://github.com/2createStudio/postcss-sprites/pull/70
Sorry this took so long :/
Would it make sense to have hook when spritesheet is created?
One use case for this is image optimization with tool like imagemin where you could act on spritesheet image buffer and optimize it before it is saved (similar to
transform
for postcss-copy). This could be done in separate process like Gulp plugin or plugin like postcss-copy, but it seems like this could be nice addition to whole sprite generate process.filterBy
andgroupBy
where you would resolve with new spritesheet object.onSaveSpritesheet
hook to have possibility of returning spritesheet object:I’m leaning to solution number 2; open to modification and left to developers and how they want to handle final output.
Example:
What do you think? Is this too much?