Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(interactive): hide opposite theme code blocks #2073

Merged
merged 6 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions interactive/components/Summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import { searcher } from '~/composables/state'

const isDefault = $computed(() => (userConfigRaw.value || defaultConfigRaw) === defaultConfigRaw)

// To show | hide list of presets
const showPresets = ref(false)
zyyv marked this conversation as resolved.
Show resolved Hide resolved
</script>

<template>
Expand Down
4 changes: 3 additions & 1 deletion interactive/components/details/Guide.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
import type { GuideItem } from '~/types'

import { isDark } from '#imports'
zyyv marked this conversation as resolved.
Show resolved Hide resolved

const { item } = defineProps<{
item: GuideItem
}>()
Expand All @@ -17,7 +19,7 @@ watch(
</script>

<template>
<DetailsBase v-if="component" :title="item.title">
<DetailsBase v-if="component" :title="item.title" :class="{ light: !isDark, dark: isDark }">
zyyv marked this conversation as resolved.
Show resolved Hide resolved
<div class="markdown-body max-w-full mt4 text-left">
<component :is="component" />
</div>
Expand Down
7 changes: 7 additions & 0 deletions interactive/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -896,3 +896,10 @@
opacity: 0.6;
}
}

.light .shiki.Vitesse.Dark {
display: none;
}
.dark .shiki.Vitesse.Light {
display: none;
}