[英]GWT: How to access in one stylesheet constants defined in another stylesheet from the same ClientBundle
[英]How to import image from one ClientBundle to use it in style of another ClientBundle
我有一個客戶包:
public interface FirstClientBundle extends ClientBundle {
public static final FirstClientBundle INSTANCE =
GWT.create(FirstClientBundle.class);
@Source("panel-top-bg.png")
public ImageResource panelTopBg();
}
我想以另一個捆綁包的樣式使用第一個捆綁包中的圖片。 像這樣:
public interface SecondClientBundle extends ClientBundle {
public static final SecondClientBundle INSTANCE =
GWT.create(SecondClientBundle.class);
public interface Style extends CssResource {
@ClassName("panelTop")
String panelTop();
}
@Source({ "style.css" })
public Style style();
}
CSS文件看起來像這樣:
@sprite .panel-top {
gwt-image: "FirstClientBundle.panelTopBg";
height: 18px;
cursor: move;
}
可能嗎? 還是我應該以不同的方式做整件事?
您可以將第二個ClientBundle
編寫為第一個的子接口嗎?
public interface SecondClientBundle extends FirstClientBundle
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.