I found the answer to the first part of my question!! I am able to import a shared CSS reference file by using the following: <ui:style ... src="../colors.css">
That makes the @def entries in colors.css visible to any style rules in the <ui:style> section. My next challenge is going to be a configuration so that the colors.css file can be changed at runtime but that will come later. For now, I hope anyone else trying to accomplish the first half if this find the forum post :) On Mar 19, 10:42 am, Will <[email protected]> wrote: > My GWT project is to the point where I want to standardize the widget > colors by defining the colors in one place and accessing the color > definition within the <ui:style> section of each of my widgets. I am > using GWT 2.0.3 and the latest Eclipse plugin (if those are relevant). > > Example: > colors.css: > @def TEXT_COLOR #aabbcc; > > MyWidget.ui.xml: > <ui:style> > ... > .widget{ > color: TEXT_COLOR;} > > <ui:style> > > The problem I am running into is how do I correctly reference the > colors.css so that the definitions are accessible within the > <ui:style> section of MyWidget.ui.xml? I tried the following without > any success > <ui:with field="colors" src="../colors.css"/> before the <ui:style> > section. > @Import("../colors.css") from within the <ui:style> section. > > If there is a better way to approach the design then please let me > know. The end goal is to be able to reference external css > definitions from within the UiBinder's <ui:style> and an extra bonus > would be if I could change the referenced file at runtime :). I am > looking at UserBundle but I'm still at a loss for how to access any > imported ResourceBundle from within the <ui:style> section. Any help > is much appreciated -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
