Assuming the GUI library you mentioned is a GWT module, the easiest
thing to do is to reference the CSS file from the module definition
file:

    <stylesheet src="Library.css"/>

Then make sure that Library.css is in a package named "public" next to
the module definition file. The CSS will then be automatically loaded
when the module is loaded on the host page. Just be careful with your
selectors, since they will be global to the page. This method is best
for ".gwt-*" styles.

If you don't need the styles on the host page outside of where the
application lives, you should consider using ClientBundle and
CssResource instead:

    
http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Using_an_external_resource

That will obfuscate (and optimize) your class selectors so they don't
collide with anything on the host page. You also get programmatic
access to the obfuscated class names so you can dynamically apply the
styles. Based on your description, this would probably be the best
approach in your case.

-Brian

On Jul 7, 12:27 pm, Hethcox <heth...@gmail.com> wrote:
> Hello,
> I have a GUI library that is used by several GWT apps. I would like
> the widgets in the library to use a standard sets of CSS classes from
> the library so that they don't have to be copied and maintained in the
> apps that  use the library. The library is deployed as a jar
> currently, but that can change.
>
> I've read a lot of posts on this topic, but none of them seems to do
> the trick. My target platform is JBoss and the closest solution I've
> found so far is to put the library CSS file in ROOT.war/css at deploy-
> time. Is there a build-time trick to get the GWT apps to deploy the
> CSS file when it cross-compiles the library widgets?
>
> Cheers,
> John

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to