Search code examples
javagwtgoogle-closure-stylesheetgss

Removing duplication across Google Stylesheets (GSS) in GWT


Most of my stylesheets (GSS) have the same set of @defmixin statements. I would like to be able to remove the duplication.

Is it possible to @include a common GSS stylesheet in some way? Or are there other ways to do this simply? (I mean without having any external scripting to munge the files.) I'm using GSS from a GWT 2.8 app, by the way.

I found a related question but the answers aren't really appropriate for using GSS within GWT.


Solution

  • I just found the answer by looking at the GWT code. You can't include files, but you can combine several GSS files by specifying them all in the @Source annotation. E.g.

    @Source({"Shared.gss", "BookEditor.gss"})
    

    Hope this helps someone else with the same question.