Skip to content

Commit

Permalink
feat: add theme as classname to sandbox (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Jan 7, 2024
1 parent 481035a commit 7e9dc0f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/output/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ watch(
// reset sandbox when version changes
watch(() => store.state.resetFlip, createSandbox)
// reset theme
watch(
() => theme.value,
(value) => {
const html = sandbox.contentDocument?.documentElement
if (html) {
html.className = value
}
}
)
onUnmounted(() => {
proxy.destroy()
stopUpdateWatcher && stopUpdateWatcher()
Expand Down

0 comments on commit 7e9dc0f

Please sign in to comment.