Problem CSS Label In CustomComponent

Hi , Im new in vaadin and this is my first question , hope somebody can help me
I have a UI Class Named

[code]
public class EEE extends UI {

   private Navigator navigator;

   @WebServlet(value = "/*", asyncSupported = true)
   @VaadinServletConfiguration(productionMode = false, ui = DDC.class)
   public static class Servlet extends VaadinServlet {

   }

   @Override
   protected void init(VaadinRequest request) {

  
         navigator = new Navigator(this, this);
         navigator.addView(Funcion1.NAME, new Funcion1());
         navigator.navigateTo(Funcion1.NAME);

   }

}
[/code]And in the class Funcion1 i use Vaadin User Interface

public class Funcion1 extends CustomComponent implements View { ……… } . Everything is okey except , that I can put CSS in a Label “total” the field StyleName I put my theme . like this

Image1 In Attachment

I have my CSS File
Image 2 Attachment

With

[code]
@import “…/reindeer/legacy-styles.css”;

.v-label {

   background-color: red;
  
    }

[/code] it doesn’t work , my question is this .

If I put mytheme in Label StyleName doesn’t work
If I put @Theme(“mytheme”) in Funcion1 doesn’t work .
But if I put @Theme(“mytheme”´) in EEE who call Funcion 1 , my CSS works !
So , Can I put CSS in Class extend CustomComponent ? or in a Style Name field and I am doing something wrong ? , I said this because I need several theme , like
Funcion1 mytheme
Funcion2 mytheme2 like this.

Sorry for my English
Thanks !

17227.png
17228.png

Theme is associated with UI, so if you want to customize style you have to name your style marker and add definition into ui theme:

Label label = new Label(....);
label.addStyleName("my-custom-label");
.v-label .my-custom-label {
      
       background-color: red;
      
}

That needs to be .v-label.my-custom-label in order to work (no space between the class selectors). They are targeting the same element, so they need to be combined.

Thanks with the space didn’t work and now yes !