-
Notifications
You must be signed in to change notification settings - Fork 188
Description
Describe your motivation
As discussed in vaadin/flow-components#3600 you cannot just set the theme in body element, but it needs to be applied html element instead. This leads to calling JS in instead of using Java API for setting theme.
Logical use case is: "I want to set the theme for my application." Specifically e.g. "I want my application to use dark theme".
Currently this would be:
UI.getCurrent().getPage().executeJs("document.documentElement.setAttribute('theme', '"+Lumo.DARK+"')");
Describe the solution you'd like
Since page-level API is needed a logical API would be:
UI.getPage().getThemeList().set(Lumo.DARK, true);
Describe alternatives you've considered
From application developer point of view UI.getThemeList would make more sense, but since it is likely needing the the Page level API internally, it would be more natural starting point for Java API.
Additional context
No response