vaadin组件setstylename无效

时间:2016-01-21 14:54:02

标签: css vaadin vaadin7

以下内容应该有效。但事实并非如此。 (Css改变没有任何影响)出了什么问题?

@Theme("mytheme")
@Widgetset("de.datalovers.MyAppWidgetset")
public class MyUI extends UI {

    @Override
    protected void init(VaadinRequest vaadinRequest) {
        verticalLayout = new VerticalLayout();
        String s = "Montag 07:30 - 12:00"
        Label label = new Label();
        label.setStyleName("mystyle");

mytheme.sccs:

    @import "../valo/valo.scss";

@mixin mytheme {
  @include valo;

  // Insert your own theme rules here

  .mystyle{

    color: blue;
    background: yellow;
    font-size: 40px;

  }
}

styles.sccs

@import "mytheme.scss";
@import "addons.scss";

// This file prefixes all rules with the theme name to avoid causing conflicts with other themes.
// The actual styles should be defined in mytheme.scss

.mytheme {
  @include addons;
  @include mytheme;
}

1 个答案:

答案 0 :(得分:1)

使用CSS和Vaadin时不要忘记清空缓存(CTRL + F5)。在处理样式表后重新编译主题。