Closed Orion98MC closed 11 years ago
Currently, it is not. I think the solution for this will be an option for mapping original sprite names to CSS names.
{
cssVarName: function (sprite) {
return sprite.name.replace('@', '-');
}
}
As an interim workaround, you can use a grunt rename task to rename all hdpi images to something more tolerable and load those into spritesmith.
Adding functionality now. Should be ready in a bit.
Alright, I decided to make it more generic and added the cssVarMap
option. Your config should look like:
{
cssVarMap: function (sprite) {
sprite.name = sprite.name.replace('@', '-');
}
}
More info can be found in the README. This has been released in 1.11.0
.
Great thanks, I kinda did something similar in the meantime but It's great to see you had the time to do it. For the record I also adapted json2css and the less template for HiDPI images if you are interested in the changes I can fork and submit a pull request.
I would be open to adding some hi-res templates to json2css
. Although, spritesmith
was not built with retina in mind, it would lower the barrier for someone to create a hi-res tool on top of spritesmith
that takes care of the nuances and allows for switching strategies of how to approach retina.
As a heads up, we have added retina support in grunt-spritesmith@4.5.0
. More information can be found here:
https://github.com/Ensighten/grunt-spritesmith#retina-parameters
https://github.com/Ensighten/grunt-spritesmith#retina-spritesheet
Great! Thanks for the heads up. Can't wait to use it in a future development.
Hi, I noticed that for .css format it's possible to alter the class names using cssOpts. However is it possible to do the same for the generated less @variables? I'm using hidpi images with "@2x" in their names which makes a lessc error.
Regards, Thierry