I just created Vaadin 25 empty project and played with
@StyleSheet(Lumo.STYLESHEET)
and
@StyleSheet(Aura.STYLESHEET)
I see that existing Vaadin components (like Button) change theme and it works as expected.
But if I create something like this:
@Route("")
public class ExampleView extends VerticalLayout {
public ExampleView() {
Span badge = new Span("Hello World");
badge.getElement().getThemeList().add("badge success");
add(badge);
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.getStyle()
.set("border", "2px solid var(--lumo-contrast-10pct)");
verticalLayout.add(new Button("Click me"));
add(verticalLayout);
}
}
Badges & borders work only with Lumo.STYLESHEET. It’s kinda logical for border not to work because I’m using lumo variable. But for badges it’s probably some bug. If I want to change theme for some existing large project where I have some custom styling using Lumo variables I need to rewrite all that. I can add both of these themes but that has weird visual effects :D
And then I was wondering what was idea behind these themes. Is it just to choose one on the start of the project and probably never change it?