Good afternoon, I try to connect this design

Label label2 = new Label("This text has a lot of style"); label2.addStyleName("mystyle"); layout.addComponent(label2); 

this style

 .mystyle { font-family: fantasy; font-style: italic; font-size: 25px; font-weight: bolder; line-height: 30px; } 

but how to do this I can not understand, this style is registered in the folder of the mytheme project in the style.css file is not connected in the same place created a separate file mystyle.css the result is the same what is the reason?

  • style.css this style.css connect to the final html? - Artem Gorlachev
  • @ArtemGorlachev Yes. - Varg Sieg
  • It is necessary to watch the final html. label should be class="mystyle" - Artem Gorlachev
  • one
    The .mystyle{...} is generally that in order .mystyle{...} connect to an element it is necessary that the element in html has an attribute class="mystyle" ; I am not at all familiar with vaadin ( - Artem Gorlachev
  • @ArtemGorlachev I will know well, thanks for the help) - Varg Sieg

1 answer 1

When maven is generated from vaadin archityp, this structure is generated:

 src\main\webapp\VAADIN\themes\mytheme\ addons.scss mytheme.scss styles.scss 

add mystyle to mytheme.scss