Overriding Css Styles Defined via CssResource ..

82 views
Skip to first unread message

El bassistos

unread,
Jun 15, 2011, 6:22:06 AM6/15/11
to Google Web Toolkit, jesper.t...@gmail.com
I have made reusable GWT Widget which uses CssResources, where I have
marked all the styes as @external so they are not obfuscated.

I now want to override some of the styles in plain standard HTML web
site. The website is not GWT project so I can't override the styles
in a "module.gwt.xml" file..

I can see in FireBug that my styles from the re-used GWT Widget are
loaded after my <link style= ...> even if I define the script tag
<script src= ..> after the <link ..>

I can see that if I use the Css property !important then I can
"override" or "important'fy" individual properties but that is really
not a user-developer friendly solution ..

Any Ideas ??

Jeff Larsen

unread,
Jun 15, 2011, 2:09:22 PM6/15/11
to google-we...@googlegroups.com, jesper.t...@gmail.com
The styles from CSS resource are always going to be loaded after any static .css files. They are programatically injected (CssResource#ensureInjected())

One option would be to not use CssResource, but that is probably a bad one. 

Someone else solved this problem pretty elegantly


but this will probably be a signifigant refactor for you. 
Reply all
Reply to author
Forward
0 new messages