What is the selection method for adjusting CSS changes in vaadin?

I am struggling with some minor layout changes in vaadin that need to be implemented on the Java and Css side.

Every time I need to customize the layout, for example padding-top, background color or bold text of one component, I also need to set the style using Java code:

userLink.setStyleName("textbold"); 

The changes to my .css styles (under VAADIN / themes / app /) will be as follows:

 @import "../runo/styles.css"; .textbold { font-weight: bold; } ... 

Is this the right way to change CSS, or is there another way? Can I do this without affecting the Java code?

+4
java css layout vaadin
May 13 '10 at 1:18
source share
1 answer

This is the way.

You would do the same in HTML. You define the class name in the CSS file and associate the class name with your HTML element. Another way would be to directly set the style in JAVA (for example, you could do it directly in HTML), but this is not recommended.

+1
May 21 '10 at 7:01
source share



All Articles