CSS Sprite generation in gradle build process?

試著忘記壹切 提交于 2019-12-07 06:11:03

问题


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.


回答1:


@Windwalker you might be interested in using the SmartSprites Maven Repositry in your gradle. It takes individual images and creates a sprite image using that along with the required CSS.

The details for the repository can be found at: http://mvnrepository.com/artifact/com.carrotsearch/smartsprites/0.2.8

To install it into your project simply put the following line in your gradle commands :

'com.carrotsearch:smartsprites:0.2.8'

The full details about the

As the website of Smart Sprite [ http://csssprites.org/ ] says:

SmartSprites will let you easily introduce and maintain CSS sprites in your designs. SmartSprites parses special directives you can insert into your original CSS to mark individual images to be turned into sprites. It then builds sprite images from the collected images and automatically inserts the required CSS properties into your style sheet, so that the sprites are used instead of the individual images

I hope this solves your situation.




回答2:


http://csssprites.com/
http://spritegen.website-performance.org/
http://css-sprit.es/

A few online tools that will generate the sprites along with the CSS code.



来源:https://stackoverflow.com/questions/12554926/css-sprite-generation-in-gradle-build-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!