我在Vaadin的valo主题之上定义了自己的自定义主题。
这里是文件mycustomtheme.scss的内容:
//this line works, it sets the background-color of the app to light-blue:
$v-background-color: hsl(192°, 61%, 51%);
//the following line is supposed to set the font-color in the app to white but has no effect, the font-color in the app is still black:
$v-font-color: rgb(255, 255, 255);
@import "../valo/valo.scss";
@mixin mycustomtheme {
@include valo;
//the following 3 lines don't have any effect either. The background-image does not get displayed:
.defaultView {
background-image: url("urlOf/Image");
}
}
要为其设置背景图像的组件的java代码是:
//other code ...
gridLayout = new GridLayout(4,2);
gridLayout.setSizeFull();
gridLayout.addStyleName("defaultView");
addComponent(gridLayout);
//more code ...
1。)为什么将背景颜色设置为蓝色,但将字体颜色设置为白色不起作用?我根据Vaadin团队的例子检查了我的代码,我无法看到我可能做错的事情:
https://vaadin.com/docs/v8/framework/articles/ValoExamples.html
2.。)为什么没有显示背景图像?