我在 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.) 为什么不显示背景图像?