Wrong sprite dimensions
See original GitHub issueWhen using the retina-sprite mixin, I get the wrong width and height for my sprites.
Let’s say a sprite is supposed to appear 46px wide and high on the page. The retina-sprite mixin will use 92px for the CSS height and width instead, from the dimensions of the retina .png.
Here’s the task I’m using to generate my sprites:
// Manage sprites gulp.task('sprites', function () { var spriteData = gulp.src([ imagePaths.source + "sprites/*.png", imagePaths.source + "sprites-2x/*.png" ]) .pipe(spritesmith({ retinaSrcFilter: imagePaths.source + "sprites-2x/*.png", imgName: 'spritesheet.png', retinaImgName: 'spritesheet-2x.png', cssName: '_sprites.scss' })) .on("error", handleError); var imgStream = spriteData.img .pipe(buffer()) .pipe(imagemin(imageMinConfig.pngQuant)) .pipe(gulp.dest(imagePaths.dist + 'sprites/')); var cssStream = spriteData.css .pipe(gulp.dest('./sass_helpers')); return merge(imgStream, cssStream); });
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
That’s done the trick. Thanks for your help!
We have created a test and patch in
6.5.0
to resolve this issue