Sanyifejű
Sanyifejű

Reputation: 2740

vaadin component setstylename has no effect

The following should work. But it does not. (Css change has no effect whatsoever) What went wrong?

@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;
}

Upvotes: 1

Views: 859

Answers (1)

cgew85
cgew85

Reputation: 427

Dont forget to empty cache (CTRL + F5) when working with CSS and Vaadin. And recompile theme after working on your stylesheets.

Upvotes: 1

Related Questions