Reputation: 61
I need to format the errrorindicator depending on the textfields stylename. I couldn't find any css rule which takes the v-errorindicator style in dependence of a stylename for the textfield e. g.
.my-stylename-for-textfield .v-errorindicator {
style: xxx;
}
Does someone know a posibility?
Best regards Bernhard
Upvotes: 0
Views: 102
Reputation: 2803
You can't style the errorindicator depending on your textfield style, you can style it depending on your overall theme name.
What I mean is that, Vaadin will generate a CSS file that's specific to your theme name, wihch you specify in you main UI:
@Theme("mytheme")
public class MyVaadinUI extends UI {
//....
And generates a CSS that looks like the following:
.mytheme .v-textfield {
text-align: left;
}
So you need to style your errorindicator specifying the name of your theme and the CSS hierarchy, which in your case is under the textfield:
.mytheme .v-textfield .v-errorindicator {
color: blue;
}
If you need more info on how to use Vaadin themes, check out the Theme chapter in the Vaadin book.
Upvotes: 1