Skip to content

Commit 7e9dc0f

Browse files
authored
feat: add theme as classname to sandbox (#203)
1 parent 481035a commit 7e9dc0f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/output/Preview.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ watch(
5151
// reset sandbox when version changes
5252
watch(() => store.state.resetFlip, createSandbox)
5353
54+
// reset theme
55+
watch(
56+
() => theme.value,
57+
(value) => {
58+
const html = sandbox.contentDocument?.documentElement
59+
if (html) {
60+
html.className = value
61+
}
62+
}
63+
)
64+
5465
onUnmounted(() => {
5566
proxy.destroy()
5667
stopUpdateWatcher && stopUpdateWatcher()

0 commit comments

Comments
 (0)