A theme module for the overlay could look like this:
:host([theme~="custom-theme-variant"]
) [part~="overlay"]
{
color: green;
}
In order to take it into use you’ll need to use @CssImport to include it:
@CssImport(value = "./styles/custom-overlay-theme.css", themeFor = "vaadin-*-overlay")
and set a theme
attribute to match the one in the selector:
MenuBar menuBar = new MenuBar();
MenuItem someItem = menuBar.addItem("Some text");
someItem.getSubMenu().addItem("Subitem");
menuBar.setThemeName("custom-theme-variant");