Vaadin Label CSS

Viewed 66

I want to apply CSS for Vaadin 23 label but its not working properly. Please suggest me appropriate process.

Label label1 = new Label("Temp");
label1.addClassName("bold-label");

vaadin-label.css:

:host(.bold-label) [part~="label"] {
    font-weight: bold;
    color:red;
}
1 Answers

Label is standard HTML element. See Mozilla Developer documentation. Not a specific Vaadin crafted component with shadow DOM (where you would need the vaadin-*.css in the components folder).

Instead you can put your css inside styles.css and use a simple label.bold-label selector.

Related