5

I recently read an article about Javascript, where Build Tools like Grunt and Ender were mentioned. It was briefly stated, that such tools are capable of generating sprite images from individually provided files and that these build tools can be integrated into the build process.

Unfortunately my google searches didn't unveil more information on this. Does anybody here have experience on this topic and integration into gradle? Some web resources for further reading are highly welcome!

Many thanks in advance! Sascha.

4

2 回答 2

1

@Windwalker 您可能有兴趣在您的 gradle 中使用 SmartSprites Maven 存储库。它采用单个图像并使用它以及所需的 CSS 创建一个精灵图像。

可以在以下位置找到存储库的详细信息:http: //mvnrepository.com/artifact/com.carrotsearch/smartsprites/0.2.8

要将其安装到您的项目中,只需在您的 gradle 命令中添加以下行:

'com.carrotsearch:smartsprites:0.2.8'

关于

正如 Smart Sprite [ http://csssprites.org/ ] 的网站所说:

SmartSprites 将让您轻松地在设计中引入和维护 CSS 精灵。SmartSprites 解析可以插入原始 CSS 的特殊指令,以标记要转换为 sprite 的单个图像。然后它从收集的图像中构建精灵图像,并自动将所需的 CSS 属性插入到您的样式表中,以便使用精灵而不是单个图像

我希望这能解决你的情况。

于 2012-10-10T11:33:31.310 回答
0
http://csssprites.com/
http://spritegen.website-performance.org/
http://css-sprit.es/

一些在线工具可以生成精灵以及 CSS 代码。

于 2012-10-10T21:19:17.900 回答