I really like your solution. Thank you for sharing your solutions. But I wonder how do you deal with the new gwt widgets which support CssResource's. I'm not sure if your solutions will be working for example with CellBrowser or SimplePager. They come with bundled default Resources and they inject the styles in the constructor. I understand that my BaseClientBundle can look like this :
interface BaseClientBundle extends ClientBundle{ @Source("greenTheme.css") SomeCssResource getCssResource(); CellBrowserResources getCellBrowserResources(); } And during the instantantion of the CellBrowser I can pass CellBrowserResources instance. But this approach seems to be error prone. A developer can easily forget to pass the resource reference from current theme bundle, and in the result he will get default styling. Also theming such a widget inside uibinder, forces us to manually create the widget, which reduces productivity. So my question is how do you cope with widgets which uses resources internally ? Not only with leagacy (written in old manner) widgets. On Oct 29, 2:53 pm, Jeff Larsen <larse...@gmail.com> wrote: > On Oct 29, 2:03 am, wolfgang <wor....@gmail.com> wrote: > > > > > > > > > > > I was facing the same question and my solution was to have my main > > theme in a CSSResource file. > > This resource file is injected during the loading procedure of the > > app. > > Since the layout of my app is defined through CSS, I only allow to > > change a few things (like color, font-style, various sizes ...). > > For this I use the runtime substitution (@eval) - so I can change > > things during runtime. I only have to (re-)inject the affected > > stylesheet again. > > This works fine so far and I'm not knowing an other way to do this. So > > if there's a better way - please post. > > > > GWT helps *me* to not have to worry so much about > > > browsers-that-aren't-Firefox. But what happens when I hand over the > > > WAR (with just HTML, CSS, and JavaScript) to a third party and they > > > want to add their own branding? Do *they* then have to worry about > > > cross-browser issues? Or would I have to limit them to using > > > "portable" CSS only? > > > Since I'm using CSSResource there is no way to replace the css file > > without compiling the app again (the css styles may be obfuscated and > > added to the widgets). I hope this is correct. > > I haven't tried this, but my guess is you could create a client bundle > with all your goodies inside it. Then extend that client bundle and > override the various style sheet source locations, then you could just > selectively inject the client bundle into your application. > > interface BaseClientBundle extends ClientBundle{ > > @Source("greenTheme.css") > SomeCssResource getCssResource(); > > } > > interface ExtendedClientBundle extends BaseClientBundle{ > �...@source("yellowTheme.css") > SomeCssResource getCssResource(); > > } > > You may need to reload the page to make sure that the yellowTheme.css > doesn't get some funky behavior from greenTheme, but this should allow > you to swap out skins on the page. -- 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.