Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ClientBundle image resources in css urls

Tags:

css

gwt

uibinder

I'm building an application in GWT and have a skin from my graphic designer which I've plugged into the app using UIBinder and it works beautifully. Now I want to bundle all the images using ClientBundle.

Mayne of these images are used in the css file e.g.

.nav{background:url(nav_bg.jpg) left top repeat-x; height:27px; clear:both;}

Before this css I have defined a tag to include the bundle.

How can I change the css entry so that it uses an ImageResource from my ClientBundle? I guess I can do inline styles for all the html tags but that's horrible separation and a lot of extra work.

I have successfully used ImageResources in the html part of the uibinder file (e.g. in a ) but I cannot see how to do this in the css. I have even inlined the css in a block but I still don't see the correct way to do this.

Any suggestions?

like image 484
Steve Buikhuizen Avatar asked Dec 20 '25 00:12

Steve Buikhuizen


1 Answers

ClientBundles can now be used to host CssResources as well. These CssResources are CSS files with some extra functionality.

The docs of GWT describes what you need in the section about ImageSprites.

like image 180
David Nouls Avatar answered Dec 24 '25 12:12

David Nouls



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!