简体   繁体   中英

How can I use css for Vaadin 7 components?

I've set the styleName for my component, but it doesn't appear to have any effect:

Label  label=new Label("this is test");
label.setStyleName("mytheme");

My CSS:

@import "../reindeer/styles.css";

.test{
    color: cornflowerblue;
}


.mytheme {
    font-family: 'Cabin Sketch';
    font-size: 24px;
    font-weight: bold;
    padding-top: 10px;
    padding-left: 10px;
    line-height: 30px;
}

.v-label {
    background: cyan;
}

My directory in intellij IDE: web/VAADIN/themes/mytheme

I've already seen this question , but the solution doesn't work for me.

input in main class: @Theme("mytheme")

在此处输入图片说明

and use in all project by component.setStyleName("Logo");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM