Different Colors for different Views in the same UI

Our Application consists of different parts. Each part should have a unique color scheme. A part consists usually of a couple of different views and users can switch from one part to an other.

I thought this would be a piece of cake and used 7.3 new ability to change themes. I extracted all relevant colors into variables and made a base theme. From this I derived the color-themes where I set the variables and each color-schema now has it own theme. I used a ViewChangeListener to set the Theme dependend on which view is shown. This also works but has some major problem.

When the view switches the new view is shown with the old theme for around a second till it switches to the new theme. In Firebug I see that when the theme switches the new styles.css gets loaded. In UIConnector the actual theme switch is done after the file is loaded. In Firefox it works mostly fine when switching to the theme a second time because he seems to use the cached styles.css, but this doesn’t work reliable. In IE the old theme is always shown but much shorter.

Any ideas on how to achive the color changes without theme switches or how to delay the rendering till the new styles.css is loaded?

I use Vaadin 7.3.4 on an embedded jetty server.