Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to switch to Material theme or DARK mode #5715

Closed
tanbt opened this issue May 20, 2019 · 0 comments · Fixed by #5749
Closed

Unable to switch to Material theme or DARK mode #5715

tanbt opened this issue May 20, 2019 · 0 comments · Fixed by #5749

Comments

@tanbt
Copy link

tanbt commented May 20, 2019

  • Minimal reproducible example
  • In skeleton-starter-flow project, add @Theme on top of MainView class, e.g:
package com.vaadin.starter.skeleton;

import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.server.PWA;
import com.vaadin.flow.theme.Theme;
import com.vaadin.flow.theme.lumo.Lumo;
import com.vaadin.flow.theme.material.Material;

/**
 * The main view contains a button and a click listener.
 */
@Route("")
@PWA(name = "Project Base for Vaadin Flow", shortName = "Project Base")
@Theme(value = Material.class, variant = Material.LIGHT)
//@Theme(value = Lumo.class, variant = Lumo.DARK)
public class MainView extends VerticalLayout {

    public MainView() {
        Button button = new Button("Click me",
                event -> Notification.show("Clicked!"));
        add(button);
    }
}
  • Expected behavior
    Themes and modes are switched respectively.

  • Actual behavior
    Only Lumo theme and Lumo.LIGHT mode are used as default and cannot be changed.

  • Versions:

    • Vaadin / Flow version: 14 beta1
    • Java version java version "1.8.0_202"
    • OS version Windows 10
    • Browser version (if applicable) Chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants