How to apply complex styles using CSSResource in GWT

141 Views Asked by At

In my project I your CSSResource bundle to apply styles accros the project.

How do I apply more complex styles such as given in the example ?

I do not manage to get the child style applied using x.setStyleName(refToCss.MenuBar()) and addStyleName(refToCess.MenuItem()).

In my case the second (child) style MenuItem just seems to be ignored.

I just use this menubar as example here. What I want to achieve is having multiple components with multiple states. E.g. .component1 .stateA, component2 .stateA .. where state A has different visual appearance for component1 and component2.

(Actually as CSS should work).

Thanks in advance, Wouter

1

There are 1 best solutions below

2
Suresh Atta On
In my case the second (child) style MenuItem just seems to be ignored.

In order to ignore you should use

x.setStylePrimaryName(refToCss.MenuBar());