If I have for example a view where I use
@CssImport(value = "somefile.css")
with somefile.css defined like
.test-foobar {
color: green
}
I can use .addClassName("test-foobar") in any component in any view/class even if the class is NOT annotated with @CssImport(value = "somefile.css").
It's like that once defined the @CssImport it's global available to all the views.
Other than hard-coding css definition in the class file for every component can you define a css rules in a file that is just imported and used for the view that is annotated with @CssImport ?
P.S. I am using vaadin 14 right now, but it is ok to have informations if it is different in 23+, just to know how it works.