How to create different Themes on top of Valo in Vaadin?

老子叫甜甜 提交于 2019-12-04 07:07:20

read the fine manual: https://vaadin.com/book/vaadin7/-/page/themes.valo.html#themes.valo.use

there is a whole section dedicated to Valo

the different themes on top of Valo as seen in the valo-demo are all done with the setting of the main SASS variables seen in the book.

e.g. https://github.com/vaadin/valo-demo/blob/master/src/main/webapp/VAADIN/themes/tests-valo-flatdark/_variables.scss

James Baxter

Further to the accepted answer, you can specify the theme using the @Theme annotation on your UI class and extend the theme by creating a folder with the name of your theme under VAADIN\themes.

Inside that folder you'd create a styles.scss and .scss:

styles.scss

@import "licensing.scss";

.licensing {
  @include licensing;
}

licensing.scss

@import "../valo/valo.scss";

@mixin licensing {
  @include valo;
}

Theme annotation: Example on github.

Theme files: Example theme folder.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!