Skip to content

Commit 319f438

Browse files
committed
fix: cause when github-dark theme showed in light theme
1 parent c3ec2d3 commit 319f438

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

components/midori/editor.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ onMounted(() => {
127127
const editor = document.querySelector<HTMLElement>('pre.elysia-editor')
128128
129129
editor.innerHTML = highlighter.codeToHtml(code, {
130-
theme: isDark ? 'github-dark' : 'github-light',
130+
theme: isDark.value ? 'github-dark' : 'github-light',
131131
lang: 'javascript',
132132
})
133133
@@ -136,7 +136,7 @@ onMounted(() => {
136136
137137
editor.innerHTML = highlighter.codeToHtml(
138138
event.currentTarget.innerText, {
139-
theme: isDark ? 'github-dark' : 'github-light',
139+
theme: isDark.value ? 'github-dark' : 'github-light',
140140
lang: 'javascript',
141141
})
142142
@@ -194,7 +194,8 @@ onMounted(() => {
194194
</p>
195195

196196
<aside class="flex flex-col md:flex-row justify-center items-center w-full max-w-6xl gap-8 my-8">
197-
<section class="flex flex-col w-full h-96 border dark:border-slate-700 bg-white dark:bg-slate-800 rounded-2xl">
197+
<section
198+
class="flex flex-col w-full h-96 border dark:border-slate-700 bg-white dark:bg-slate-800 rounded-2xl">
198199
<div class="mockup-window flex relative w-full h-full shadow-xl">
199200
<pre class="elysia-editor block !bg-transparent !text-base !font-mono rounded-xl w-full max-w-xl h-full !pt-0 !px-2 outline-none"
200201
contenteditable="true">

components/midori/index.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ import '../tailwind.css'
1818
import './midori.css'
1919
2020
import BuiltWithLove from './built-with-love.vue'
21-
22-
import useDark from './use-dark'
23-
24-
const isDark = useDark()
2521
</script>
2622

2723
<template>
@@ -48,13 +44,15 @@ const isDark = useDark()
4844
<template v-slot:server>
4945
<slot name="server"></slot>
5046
</template>
47+
5148
<template v-slot:client>
5249
<slot name="client"></slot>
5350
</template>
5451
</E2ETypeSafety>
5552
<Plugins />
5653
<Suspense>
5754
<Editor />
55+
5856
<template #fallback>
5957
<video muted autoplay loop>
6058
<source src="/assets/elysia.mp4" />

0 commit comments

Comments
 (0)