Just to complement the answers here... I've found the new spriting mechanism of GWT (@sprite) to be really simple and useful. Unfortunately, it doesn't work for UiBinder-embedded CSS styles. Therefore, I rely on an external CssResource for all my styles that need spriting.
On Jul 22, 8:43 am, Sekhar <[email protected]> wrote: > Yes, separate out the common stuff into a CSS (or more, as necessary) > and put as much of the specific CSS as possible into the XML file. > Below is an example that shows this setup and its power. Note that > each UiBinder XML treats the definitions in the common file (color1 > and .roundCorners in this case) as if they're local. In fact, even > auto-complete works to identify .roundCorners even though it isn't > defined locally - very cool. > > E.g., here's the common file. > > Project.css: > ... > @def color1 #333333; > ... > .roundCorners { > ... > > } > > Then, in each custom UiBinder XML, do this: > > <ui:style src="Project.css"> > .input { > color: color1; > } > </ui:style> > ... > ... styleName="{style.input}" ... > ... styleName="{style.roundCorners}" ... > ... > > On Jul 21, 5:18 pm, David Vree <[email protected]> wrote: > > > > > If I understand you correctly, I can put the CSS that pertains > > directly to the UIBinder there...and the more general stuff I put in > > the CSS file....and they'll both get picked up? I assume here that > > the stuff in the UIBinder XML file has precendence? > > > On Jul 21, 6:50 pm, Sekhar <[email protected]> wrote: > > > > Having the CSS inside XML makes it WAY more modular and convenient to > > > tweak the UI. When I started, the common file was small, but as the > > > project grew it became unmanageable, forcing me to switch to CSS in > > > XML. I'm now a happy camper. You can pool common elements (e.g., > > > globals like colors, etc.) and source it in your different style > > > blocks. > > > > I don't believe it's possible to use sprites in the XML however, since > > > the CSS file and the bundle need to work in pairs as I understand. I > > > really hope I'm wrong on this, could someone confirm one way or the > > > other? > > > > On Jul 21, 2:21 pm, David Vree <[email protected]> wrote: > > > > > I'm new to UI Binder and see that it is possible to set CSS styles > > > > within the binder file. I've always understood a best practice to be > > > > to separate these out into a single CSS file. Why (or when) would I > > > > put CSS in the UIBinder XML file? -- 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.
