Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Sprite generation in gradle build process?

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.

like image 222
Windwalker Avatar asked Nov 12 '22 21:11

Windwalker


1 Answers

@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.

like image 167
Shubhanshu Mishra Avatar answered Nov 15 '22 11:11

Shubhanshu Mishra