Closed arnisjuraga closed 8 years ago
Can you explain why only some of your images have a retina equivalent?
Because ... sometimes I'm lazy. Some larger images (e.g. Logo) looks really bad on retina, instead of smaller icons, arrows or buttons, which are more acceptable.
Even more - Logo or some buttons for multi-language sites can have different text on every image. It just needs an extra effort to maintain all of them:
It takes more time, but IMHO - not always it's so necessary
This can be not a common thing to ask, but there are opinions here on maintaining 2x more images for sprites because of retina and possible workarounds.
Probably, solution which works for me too - generating ONLY retina display images and downsizing them for normal dpi screens. This can be done with spritesmith?
We don't directly support downsizing retina images but it fits nicely into a grunt
workflow. Here's an example setup:
grunt.initConfig({
_2x2x: {
sprites: {
imgsrcdir: '../img/icons/',
imgdestdir: '../img/icons/',
option: {
overwrite: true
}
}
},
sprite: /* same as current setup */
});
grunt.registerTask('build-sprites', ['_2x2x, 'sprite']);
https://github.com/freestyle21/grunt-2x2x
Other plugin that will work but is less slick:
Hi!
Have not found quick solution.
I have
icons
folder with all my icons. For some of them, I want to generate retina css classes.I expect Grunt task to generate additional retina classes for those and only those icons with
@2x.png
mask.If I put only one retina image and set dst to the same .png destination, grunt will generate fatal error.
My
Gruntfile.js