Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Change the style of some ComboBoxes
Hello,
we have found out how to change the appearance of a ComboBox via CSS in VAADIN. It is described in this post:
https://vaadin.com/forum#!/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;
}