diff --git a/src/output/Preview.vue b/src/output/Preview.vue index 3fad502e..50176db5 100644 --- a/src/output/Preview.vue +++ b/src/output/Preview.vue @@ -20,6 +20,7 @@ const props = defineProps<{ show: boolean; ssr: boolean }>() const store = inject('store') as Store const clearConsole = inject('clear-console') as Ref +const theme = inject('theme') as Ref<'dark' | 'light'> const previewOptions = inject('preview-options') as Props['previewOptions'] @@ -85,6 +86,7 @@ function createSandbox() { importMap.imports.vue = store.state.vueRuntimeURL } const sandboxSrc = srcdoc + .replace(//, ``) .replace(//, JSON.stringify(importMap)) .replace( //, @@ -277,7 +279,12 @@ defineExpose({ reload }) @@ -290,4 +297,7 @@ defineExpose({ reload }) border: none; background-color: #fff; } +.iframe-container.dark :deep(iframe) { + background-color: #1e1e1e; +}