Vaadin自定义css

问题描述:

我与vaadin自定义css有问题。一切都OK了,如果我在MainUI.java文件Vaadin自定义css

@Theme("valo") 
@SpringUI 
public class MainUI extends UI { 
... 

一切正常申报...但如果我加入我的新模板。在Eclipse中我的项目文件夹: 项目 - 新建 - 其他 - VADIN主题

之后,我在我的MainUI.java文件:

@Theme("myCustomTheme") 
@SpringUI 
public class MainUI extends UI { 
... 

而且我看到的只是纯文本,如果我刷新我的网页:/

我的模板文件:

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

@mixin myCustomTheme { 
    @include valo; 

    // Insert your own theme rules here 
} 

我能做些什么,我有一个VALO主题,但我可以改变一些CSS规则?

+0

你编译的主题?你在服务器日志中遇到错误吗? – cfrick

+0

我该如何编译我的主题?我使用弹簧启动 –

+0

常用的方法是从你的buildtool运行一个任务,在那里你添加了一些vaadin的插件,可以解决这个问题。 – cfrick

您需要的Vaadin Maven插件:

<plugin> 
    <groupId>com.vaadin</groupId> 
    <artifactId>vaadin-maven-plugin</artifactId> 
    <version>${vaadin.version}</version> 
    <executions> 
     <execution> 
      <goals> 
       <goal>update-theme</goal> 
       <goal>update-widgetset</goal> 
       <goal>compile</goal> 
       <!-- Comment out compile-theme goal to use on-the-fly theme compilation --> 
       <goal>compile-theme</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin> 

然后,您可以点击在Eclipse这个按钮:

enter image description here