css - vaadin 组件 setstylename 无效

标签 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;

  }
}

样式.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;
}

最佳答案

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

关于css - vaadin 组件 setstylename 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34926980/

相关文章:

html - "cursor: pointer"根本不工作

css - 垂直和水平居中 CSS 背景图像 Sprite

css - float 元素保持内部较窄 block 元素的完整 "original"宽度

vaadin - 瓦丁如何工作?

java - 在 vaadin Accordion 中交换选项卡

javascript - 为什么点击事件没有到达<body>?

java - Liferay 7 和 Vaadin 8 : Vaadin Shared is not active

java - Vaadin 10 对话框不显示

java - Vaadin 7 中的导航器

java - vaadin 标签中的 Html 内容