Style the background of a Vaadin 14 Dialog

Viewed 289

I want to change the background-color of a Vaadin 14 Dialog. I did not get it how to do it. There is no method for it. The id is "overlay" and the color is #3b85e6.

How to do that? I only managed to add styles to the content, but i want to change the background.

1 Answers

In your Java code, your view class, add import for styles.

@CssImport(value = "./styles/my-dialog.css", themeFor = "vaadin-dialog-overlay")

And create file "frontend/styles/my-dialog.css", whos content is

:host {
    background: #3b85e6;
}
Related