この問題は、例で最もよく説明されています。
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;
(...)
これで、defines.cssUIBinder テンプレート内のスタイルシートとアプリケーション コードで定数を問題なく使用できますが、appStyle.css.
スタイルシートから継承することで「子」スタイルシートの定数にアクセスできるようになることを期待して、すでに に置き換えてみましinterface Style extends CssResourceたが、GWT コンパイラーは次のようなエラーで不平を言います。interface Style extends DefinesDefinesStyle
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{}
(...)
これを達成する方法はありますか?