How to apply styling through setClassName() in Vaadin 14

I created a new project using the Spring Boot Technology stack.

I supplied my css definitions in frontend/styles/styles.css:

  .nice-background {
    background-color: #3b3f42;
    background-size: cover;
    width: 100%;
    height: 100%;

This file was referenced in

public class Application extends SpringBootServletInitializer {
    public static void main(String[] args) {, args);
} was extended with a “setClassName” instruction:

@PWA(name = "Project Base for Vaadin Flow with Spring", shortName = "Project Base")
public class MainView extends VerticalLayout {
	public MainView(@Autowired MessageBean bean) {
        Button button = new Button("Click me springbootstarter",
                e ->;

Unfortunately the background was not affected at all.
This should be real basic, so I must have overseen something very simple.
Please help!

Move your @CssImport annotation from Application to the MainView class.

Yes, it works. Terrific!
Thank you soo much!