Css即时导入

有没有办法在 Vaadin14 中即时导入 css 样式表?我@CssImport("./views/main/main-view.css")在班级的顶端使用,并且

Button lumoBtn = new Button("Lumo", click -> {
            UI ui = this.getUI().get();
            ThemeList themeList = ui.getCurrent().getElement().getThemeList(); //
            if (themeList.contains(Lumo.DARK)) { //
                themeList.remove(Lumo.DARK);
            } else {
                themeList.add(Lumo.DARK);
            }
        });

即时在黑暗和光明之间切换。但是现在我也希望能够在 Material、Lumo 和其他 AbstracTheme 之间动态切换。

回答

您无法在运行时在主题之间切换,这是一个缺失的功能:https : //github.com/vaadin/flow/issues/5163


以上是Css即时导入的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>