PDA

View Full Version : Instantly switching CSS-Themes? (and how to change back to default?)



tobiu
7 Jul 2007, 11:26 AM
hi together,

when i load my page using none of the xthemes and on an event calling:


Ext.util.CSS.swapStyleSheet('theme', "extJS/resources/css/xtheme-aero.css");

the css-theme aero is inserted without reloading the page and it works quite nice (except of some small bugs -> not all css-attributes are in the css, so if i change from aero to vista dark theme, the tabs etc. dont match perfect).

when i want to use the default again, i use:


Ext.util.CSS.removeStyleSheet('theme');

this works fine too, but only if the default-theme is the "first" theme when the page is loaded.

when i include the vista theme right at the start, the removeStyle function has no effect at all.

to solve it, i could create a xtheme-default.css-file, copying from more global css-files. this would take quite long. is there an easier way or does this file exist already?


thanks and kind regards, tobiu

tobiu
12 Jul 2007, 1:26 PM
i'm still thinking about this.

the main problem is, that for instantly changing css-themes, all themes have to know all classes of each existing theme and if not set, reset each single attribute.

i started with the default -theme by opening the x-theme-aero and copy'n pasting all data from ext-all.css.

not really fun...

anyone else interested in this? because if so, we could split the work to some persons and post the results here. alone, i guess i am not motivated enough, because i costs to much time for a "nice to have" gimmick.


kind regards, tobiu