MadLittleMods / gulp-css-spriter

Sprite Sheet Generation from CSS source files. The best and different approach to sprite sheets.
https://www.npmjs.com/package/gulp-css-spriter
38 stars 19 forks source link

Conditional spriting based on image url #10

Open linxiaowu66 opened 7 years ago

linxiaowu66 commented 7 years ago

Add an option to conditionally filter images based on the image URL

For example, any image with ?__spriter will be sprited

background-image: url('./images/test.png?__spriter');
MadLittleMods commented 7 years ago

Just in case you weren't aware and for people who stumble onto this issue. You can already conditionally render images with comments with some meta info in them, see https://github.com/MadLittleMods/gulp-css-spriter#meta-info

MadLittleMods commented 7 years ago

@xing-zhi We should make this a more general option for a matching function or regex, options.filter(uri, filePath)

https://github.com/MadLittleMods/gulp-css-spriter/pull/11

linxiaowu66 commented 7 years ago

@MadLittleMods Thanks a lot.