ImageResource を作成する Google/GWT の例は次のとおりです。
interface MyResources extends ClientBundle {
@Source("image.png")
ImageResource image();
@Source("my.css");
CssResource css();
}
@sprite .myImage {
gwt-image: 'image';
}
ImageResources の使用方法とスタイル名の適用方法は理解していますが...
私のアプリケーションには、CSS と遅延バインディングを使用してさまざまなウィジェットに適用される複数のテーマがあります。したがって、.myImage クラスを使用したい CSS ルール (「背景」) を定義しましたが、何もしません。
background {
background-attachment: fixed;
background-image: .myImage; //?? This is the question!
background-size: contain
}
「背景」CSS プロパティ内で .myImage クラスを使用するための構文は何ですか? background-image の引数として .myImage クラスを指定できるはずです。
編集:さらに調査を行い、DataResource を使用してこれを行うための正しい構文を見つけました。
MyClientBundle extends ClientBundle {
//Background Image
@Source("resources/background.png")
DataResource backgroundImage();
}
(マイパネル.css)
@url background backgroundImage;
.myPanel {
border-radius: 0px;
background-color:#ffffff;
opacity:0.6;
background-image: background;
}