Change css for a screen

Hello,

Is it possble to change the css settings, but only for certain screens?
I would like to have another version of .v-window-header that I can use for the screens I want to. All other screens should use the original css.

Jmix version: 1.5.5
Jmix Studio plugin version: 2.3.3-242

Hello!

Do you mean header of a screen dialog? To style a header you should get the composition component that is Vaadin Window and add style name.

For instance, if your screen is opened as dialog you can do the following:

@Subscribe
public void onInit(final InitEvent event) {
    ((DialogWindowImpl) getWindow()).getComposition().addStyleName("my-custom-screen-dialog");
}

Then write a selector in your theme:

.my-custom-screen-dialog .v-window-outerheader .v-window-header {
  color: #00bc00;
}