css in vaadin

css for any component do not work!
Label label=new Label(“this is test”);
label.setStyleName(“test”);

where is my problem?
thank u …

15633.png

Do you have a custom theme in your project (it should be under VAADIN/themes)? There should be a folder with the name of your theme and at least a style.css (if you only have scss files and no css you have to compile your theme).

Then do you set your theme properly using @Theme(“yourtheme”) in your UI class?

Do you have a style called .test or .v-label-test or something similar defined in your style.css (the dot is important)?

Did you delete the cache and reload the Website after setting the style (in firefox and chrome you can do Ctrl+Shift+R to do both in one go)?

I’ve solved …
thank u for answer…
very nice!
in vaadin 7:
web/VAADIN/themes/mytheme/styles.scss
in styles.scss:
@import url(…/reindeer/legacy-styles.css);
in vaadin class:
@Theme(“mytheme”)

Hello Experts i am new in vaadin i want to apply css on vaadin component please guide me is what is wrong in my code

This is my code

Button bButton = new Button();
bButton.setIcon(VaadinIcons.SEARCH);
h1.addComponent(bButton);
h1.setSizeFull();
h1.setSpacing(true);
bButton.addStyleName(“my”);

		 and here is my scss file 
		 
		
		@import "../valo/valo.scss";

@mixin mytheme {
@include valo;

.my{background-color:red}
}