new style class for window

Hi,
What should be done if I wanted to have two types of windows, each of which using different colors for their caption’s text?
I have changed the default color this way:
.i-window-header {
color: #0000FF;
}
But I need to introduce a new style class for other type of windows.
I have tried i-window-header-MYCLASS and i-panel-caption-MYCLASS so far (with a few combinations!) so far, but no luck with them.
Thanks,
Houman.

Hi, houman001 ,

first, you must set a window a custom style name via mywindow.setStyleName(“xxx”); Next, you have to define a new style in your custom theme css (I assume, you do have a custom theme, not changin the default t heme files directly ?):


.i-window-header xxx { 
color: #FFFF00; 
} 

Small correction: the proper CSS for Window.setStyleName(“xxx”) is

.xxx .i-window-header { color: #ffff00; } or

.i-window-xxx .i-window-header {
  color: #ffff00;
}

Pardon, my mispell. Thanks, Jouni, for the correction !
These css names and relations always mixing up in my head %)

Thanks Dmitri and Jouni,
It worked.

Please anyone help me…
How can i add custom transition for window closing.