Comment by thobias.karlsson:

I have a button widget, which I want to have different styles for according to where in my application it is inserted.

I don't use CssResource or ClientBundle since I want to be able to override the style of my button anywhere in the system. Also I'm NOT obfuscating the button style names due to this.

Example for Button.ui.xml

{{{
<ui:binder ...>
<ui:image field="ButtonBackground" src="defButtonBackground.png" repeatStyle="Horizontal" />

   <ui:style src="Button.css" />

   <g:SimplePanel ui:field="button" styleName="button" />
</ui:binder>
}}}

Button.css:
{{{
@external button;
@sprite .button {
   gwt-image: 'ButtonBackground';
}
}}}

Now I have a DialogBox, and I want to change the style for each Button inside of my DialogBox. I would like to do something like this:

Dialog.css
{{{
@external gwt-DialogBox, button;

@sprite .gwt-DialogBox .button {
/** Insert another background sprite without defining sprite in any ClientBundle or ui.xml file */
   gwt-image: url('grayBackground.png') Horizontal;
}
}}}

Is something like this possible?


For more information:
http://code.google.com/p/google-web-toolkit/wiki/CssResource
-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to