javajavascripthtmlgwtclientbundle

CssResource defining only a Part of the Classes?


I use GWT ClientBundle with CssResource. I have a css file test.css with the following classes:

.c1 {
}

.c2 {
}

When I want to use classes from test.css I have to do the following in my application:

public interface Resources extends ClientBundle {

    @Source({Css.DEFAULT_CSS })
    Css css();
}

public interface Css extends CssResource {

    String DEFAULT_CSS = "buddyis/mobile/client/views/ItemView.css";


    String c1();
    String c2();
}

The problem is that I have to define all the classes from test.css even if I don't use them. Is there a way that I have do define only the classes that I use?


Solution

  • Add the @NotStrict annotation to the CssResource.

    This should solve your problem.