以下应该有效。但事实并非如此。 (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/