Skip to content

Commit

Permalink
fix(interactive): hide opposite theme code blocks (#2073)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
zhangzheheng12345 and zyyv committed Jan 12, 2023
1 parent 5493a41 commit 61d913f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion interactive/components/details/Guide.vue
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { isDark } from '#imports'
import type { GuideItem } from '~/types'
const { item } = defineProps<{
Expand All @@ -18,7 +19,7 @@ watch(

<template>
<DetailsBase v-if="component" :title="item.title">
<div class="markdown-body max-w-full mt4 text-left">
<div class="markdown-body max-w-full mt4 text-left" :class="isDark ? 'dark' : 'light'">
<component :is="component" />
</div>
</DetailsBase>
Expand Down
12 changes: 12 additions & 0 deletions interactive/markdown.css
Expand Up @@ -895,4 +895,16 @@
s {
opacity: 0.6;
}

&.light {
.shiki.Vitesse.Dark {
display: none;
}
}

&.dark {
.shiki.Vitesse.Light {
display: none;
}
}
}

0 comments on commit 61d913f

Please sign in to comment.