Skip to content

Commit 61d913f

Browse files
elliot-zzhzyyv
andauthored
fix(interactive): hide opposite theme code blocks (#2073)
* feat: Add a list of loaded presets in summary * fix(interactive): Codes in guides are shown in both light and dark theme * fix(interactive):remove showing a list of presets in summary * chore: refactor small things * chore: update Co-authored-by: Chris <1633711653@qq.com>
1 parent 5493a41 commit 61d913f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

interactive/components/details/Guide.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { isDark } from '#imports'
23
import type { GuideItem } from '~/types'
34
45
const { item } = defineProps<{
@@ -18,7 +19,7 @@ watch(
1819

1920
<template>
2021
<DetailsBase v-if="component" :title="item.title">
21-
<div class="markdown-body max-w-full mt4 text-left">
22+
<div class="markdown-body max-w-full mt4 text-left" :class="isDark ? 'dark' : 'light'">
2223
<component :is="component" />
2324
</div>
2425
</DetailsBase>

interactive/markdown.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,4 +895,16 @@
895895
s {
896896
opacity: 0.6;
897897
}
898+
899+
&.light {
900+
.shiki.Vitesse.Dark {
901+
display: none;
902+
}
903+
}
904+
905+
&.dark {
906+
.shiki.Vitesse.Light {
907+
display: none;
908+
}
909+
}
898910
}

0 commit comments

Comments
 (0)