Change the style of some ComboBoxes

we have found out how to change the appearance of a ComboBox via CSS in VAADIN. It is described in this post:!/thread/115299

But the code suggested by Jouni Koivuviita changes the appearances (e.g. background color) of all combo boxes. We would like to set the background color of the required fields only.

How can this be achieved with VAADIN?

Thank you for your answers.

Can’t you add an extra class .addStyleName() and then use it to target the element you want?

When you set field as required on server side (Field.setRequired(true)) the css class v-required is automatically applied to the component.

So a rule like the following may do the job

.v-filterselect.v-filterselect-required .v-filterselect-input {
    background-color: red;