【发布时间】:2010-07-08 00:23:39
【问题描述】:
这个问题最好用一个例子来描述。
我的 GWT 应用中有以下 ClientBundle:
interface Resources extends ClientBundle {
public static final Resources INSTANCE = GWT.create(Resources.class);
@Source("defines.css")
Defines defines();
@Source("appStyle.css")
@CssResource.NotStrict
Style style();
interface Style extends CssResource {
String appLogo();
(...)
}
interface Defines extends CssResource {
String formInputBackgroundColor();
String formInputBorderColor();
(...)
}
}
appStyle.css 是应用程序使用的主要样式表,defines.css 是仅包含以下常量的样式表:
@def formInputBackgroundColor #D8ECFD;
@def formInputBorderColor #7FAAFF;
(...)
现在我可以毫无问题地在 UIBinder 模板和应用程序代码中使用 defines.css 样式表中的常量,但我不能在我的 appStyle.css 中使用这些常量。
我已经尝试用interface Style extends Defines 替换interface Style extends CssResource,希望从Defines 样式表继承可以让我访问“子”Style 样式表中的常量,但随后 GWT 编译器报错喜欢:
Rebinding my.project.client.resources.Resources
Creating assignment for style()
Replacing CSS class names
The following obfuscated style classes were missing from the source CSS file:
formInputBorderColor: Fix by adding .formInputBorderColor{}
formInputBackgroundColor: Fix by adding .formInputBackgroundColor{}
(...)
有什么办法可以做到吗?
【问题讨论】:
标签: css gwt cssresource