简体   繁体   English

如何在GWT中使用CSSResource应用复杂的样式

[英]How to apply complex styles using CSSResource in GWT

In my project I your CSSResource bundle to apply styles accros the project. 在我的项目中,您要应用样式的CSSResource捆绑包会在项目中产生影响。

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()). 我无法使用x.setStyleName(refToCss.MenuBar())和addStyleName(refToCess.MenuItem())来应用子样式。

In my case the second (child) style MenuItem just seems to be ignored. 在我的情况下,第二(子)样式MenuItem似乎被忽略了。

I just use this menubar as example here. 我仅以此菜单栏为例。 What I want to achieve is having multiple components with multiple states. 我要实现的是拥有具有多个状态的多个组件。 Eg .component1 .stateA, component2 .stateA .. where state A has different visual appearance for component1 and component2. 例如,component1 .stateA,component2 .stateA ..其中,状态A对于component1和component2具有不同的视觉外观。

(Actually as CSS should work). (实际上是CSS应该起作用)。

Thanks in advance, Wouter 在此先感谢Wouter

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

为了忽略你应该使用

x.setStylePrimaryName(refToCss.MenuBar());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM