How can I use CSS for Vaadin components?

后端 未结 1 2017
长发绾君心
长发绾君心 2021-01-03 03:38

I seem to be seeing examples, where people answer to questions how to get some specific behavior from components by adding CSS code, however nobody seems to explain how to u

相关标签:
1条回答
  • 2021-01-03 04:00

    You can create you own custom theme. See https://vaadin.com/book/-/page/themes.creating.html how to do that.
    In this theme you have a css style sheet where you can put your rules.

    On every Component you can use the addStyleName function to add an additional class name:

    Table table = new Table("MyCaption");
    table.addStyleName("mystyle");
    

    Now you can use this in your style sheet:

    @import "../reindeer/styles.css";
    
    .mystyle{
      overflow: hidden !important;
    }
    
    0 讨论(0)
提交回复
热议问题