tags:

views:

460

answers:

1

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?

+1  A: 

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.

David Nouls
True but at the price of sacrificing IE6 support.Also I can't see how to specify the "left top" part of the css rule. Only the repeat-x property seems to be supported.
Steve Buikhuizen