1

i am trying to integrate CSS file using clientBundle. i am able to build my app successfully without an error. But when i try to integrate with my app, its not getting reflected.

public interface CSSResources extends ClientBundle {
public CSSResources INSTANCE = GWT.create(CSSResources.class);
@Source("admin.css")
public MyCssResource css();



public static interface MyCssResource extends CssResource {
    String transparents();
}

}

and my admin.css file.

.transparents{
 background-color: transparent;
 }

and in my entrpoint class i am injecting my css resources file.

CSSResources.INSTANCE.css().ensureInjected();

here i am trying to change my background color for panel,

       ContentPanel menuPanel = new ContentPanel();
       menuPanel.setHeaderVisible(false);
       menuPanel.setBorders(false);
       menuPanel.setBodyBorder(false);
       menuPanel.addStyleName(CSSResources.INSTANCE.css().transparents()); // i tried all the scenario by replacing .setstyleName,.setBodyStyleName also
karthik selvaraj
  • 467
  • 5
  • 8
  • 21
  • Check (by using browser dev tool/console) that class name has been appeared in the class attribute of the DOM element. If it is, then you have to fix your css. It could be that the gxt styles are overriding your backgroud declaration (for example by using !important or more specific declaration). – Alexander Leshkin Aug 26 '17 at 05:51
  • Try this: menuPanel.getElement().addClassName(CSSResources.INSTANCE.css().transparents()); – Euclides Aug 27 '17 at 03:30

0 Answers0