Documentation versions (currently viewingVaadin 23)

You are viewing documentation for Vaadin 23. View latest documentation

Legacy theme in MPR

By default the theme used with MPR is "valo" and this can be changed with adding the MprTheme annotation with the wanted theme name to your AppShellConfigurator configuration class.

Runtime changing of the theme isn’t supported
public class Configuration implements AppShellConfigurator {

public class MainLayout extends Div implements RouterLayout {

@Route(value = "", layout = MainLayout.class)
public class RootTarget extends Div {
    public RootTarget() {
      LegacyWrapper addressbookWrapper = new LegacyWrapper(
                  new AddressbookLayout());

The theme can be a old legacy styles.css theme or a styles.scss theme. With a Sass-based theme, on-the-fly compilation works out of the box without any changes.

Using your custom theme

Using your own Vaadin legacy theme remains the same as it was. Create your theme by following the instructions in the themes documentation for Vaadin 7 or Vaadin 8.

Then add the @MprTheme annotation with your theme name on the AppShellConfigurator instance and your theme is used for the legacy framework part.

Legacy theme is applied only when a view has legacy components
Styles for non-legacy components shouldn’t be included in the legacy theme.