Skip to content

Commit 8188570

Browse files
javier-godoypaodb
authored andcommitted
fix: apply dark theme on html instead of body
Close #117
1 parent a14accd commit 8188570

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/flowingcode/vaadin/addons/demo/TabbedDemo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ public static void applyTheme(Element element, String theme) {
361361

362362
String script;
363363
if (element.getTag().equalsIgnoreCase("iframe")) {
364-
script = "this.contentWindow.document.body.setAttribute('theme', $0)";
364+
script = "this.contentWindow.document.documentElement.setAttribute('theme', $0)";
365365
} else {
366-
script = "document.body.setAttribute('theme', $0);";
366+
script = "document.documentElement.setAttribute('theme', $0);";
367367
}
368368

369369
element.executeJs(script, theme);

0 commit comments

Comments
 (0)