Using ClientBundle image resources in css urls

I create an application in GWT and have a skin from my graphic designer, which I connected to the application using UIBinder, and it works great. Now I want to link all the images using ClientBundle.

Mayne of these images is used in a css file, for example.

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

Prior to this css, I defined a tag to include the package.

How can I change the css entry so that it uses ImageResource from my ClientBundle? I think I can do inline styles for all html tags, but this is a terrible separation and a lot of extra work.

I have successfully used ImageResources in the html part of the uibinder file (for example, in a), but I do not see how to do this in css. I even included css in the block, but I still don't see the right way to do this.

Any suggestions?

+3
source share
2 answers

ClientBundles can now be used to host CssResources. These CssResources are CSS files with some additional features.

GWT docs describe what you need in the ImageSprites section .

+2
source

, GWT css . , css, /. .

1/ css , html ui css carve i.e, uibinder css. html , , css gwt css.

2/ svn/diff - gwt css/image spriting.

3/ image/css CDN, Same Origin. FYI: , XS .

, carve css , LayoutPanels, , , css css.

, , , / gwt css/images, css. , -.

0

Source: https://habr.com/ru/post/1734363/


All Articles