From 83419c4dc342ba90869b9d94daad7468e5241c59 Mon Sep 17 00:00:00 2001 From: xiaomo Date: Tue, 29 Oct 2024 13:03:28 +0800 Subject: [PATCH] docs: replace unexported cssVariables with highlight (#841) --- apps/www/.vitepress/theme/components/BlockContainer.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/www/.vitepress/theme/components/BlockContainer.vue b/apps/www/.vitepress/theme/components/BlockContainer.vue index b3ad339b..250a77bf 100644 --- a/apps/www/.vitepress/theme/components/BlockContainer.vue +++ b/apps/www/.vitepress/theme/components/BlockContainer.vue @@ -2,10 +2,9 @@ import { useConfigStore } from '@/stores/config' import { CircleHelp, Info, Monitor, Smartphone, Tablet } from 'lucide-vue-next' import MagicString from 'magic-string' -import { codeToHtml } from 'shiki' import { reactive, ref, watch } from 'vue' import { compileScript, parse, walk } from 'vue/compiler-sfc' -import { cssVariables } from '../config/shiki' +import { highlight } from '../config/shiki' import BlockCopyButton from './BlockCopyButton.vue' import StyleSwitcher from './StyleSwitcher.vue' @@ -79,10 +78,7 @@ watch([style, codeConfig], async () => { }) } - codeHtml.value = await codeToHtml(rawString.value, { - lang: 'vue', - theme: cssVariables, - }) + codeHtml.value = highlight(rawString.value, 'vue') } catch (err) { console.error(err)