style(代码配色): 全站代码换成 Dracula 配色(亮色用官方浅色版 Alucard);编辑器、题面和教程的代码块、练一练、提交详情的颜色一模一样了
Deploy / deploy (push) Canceled after 0s

原来三套配色各管一块:编辑器是 smoothy / One Dark,正文代码块和练一练是仿 GitHub,
提交详情是 Naive 自带的,同一段 printf 在一课里就有两种颜色。现在静态代码也走编辑器
那套 lezer 解析器,颜色只在 shared/highlight.css 写一份,highlight.js 删掉。

填空题顺手修好:空会把语法搅乱,(humidity ____ 40) 被认成类型声明、humidity 染成类型色,
现在空里先填上答案再解析,答案不输出。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-13 19:49:20 +08:00
1 parent 27210eac1b
commit df3b4f0dfd
18 files changed
+345 -462

No files matched your search

@@ -7,8 +7,7 @@ import CodeMirror from "./CodeMirror.vue"
import type { Extension } from "@codemirror/state"
import { autocompletion, closeBrackets, completeAnyWord } from "@codemirror/autocomplete"
import type { LANGUAGE } from "utils/types"
import { oneDark } from "../themes/oneDark"
import { smoothy } from "../themes/smoothy"
import { darkCodeTheme, lightCodeTheme } from "../themes/codeTheme"
import { styleTheme } from "shared/extensions/baseTheme"
import { enhanceCompletion } from "shared/extensions/autocompletion"
@@ -47,7 +46,7 @@ const extensions = computed(() => [
autocompletion({
override: [enhanceCompletion(language), completeAnyWord],
}),
isDark.value ? oneDark : smoothy,
isDark.value ? darkCodeTheme : lightCodeTheme,
...extraExtensions,
])
</script>
@@ -1,7 +1,6 @@
<script setup lang="ts">
import { useThemeVars } from "naive-ui"
import { renderMarkdown } from "shared/markdown"
import "shared/highlight.css"
/**
* 显示一段 Markdown / HTML 正文:题面、教程、AI 的提示和报告。
@@ -6,8 +6,7 @@ import { Icon } from "@iconify/vue"
import CodeMirror from "./CodeMirror.vue"
import { uploadImage } from "../../admin/api"
import { styleTheme } from "../extensions/baseTheme"
import { oneDark } from "../themes/oneDark"
import { smoothy } from "../themes/smoothy"
import { darkCodeTheme, lightCodeTheme } from "../themes/codeTheme"
/**
* 后台教程正文的 Markdown 编辑器:左边写,右边由教程编辑页用学生端同一套组件预览。
@@ -145,7 +144,7 @@ const extensions = computed(() => [
EditorView.lineWrapping,
imageEvents,
shortcuts,
isDark.value ? oneDark : smoothy,
isDark.value ? darkCodeTheme : lightCodeTheme,
])
const tools = computed(() => [
@@ -5,8 +5,7 @@ import { autocompletion, closeBrackets, completeAnyWord } from "@codemirror/auto
import type { EditorView } from "@codemirror/view"
import type { Extension } from "@codemirror/state"
import type { LANGUAGE } from "utils/types"
import { oneDark } from "../themes/oneDark"
import { smoothy } from "../themes/smoothy"
import { darkCodeTheme, lightCodeTheme } from "../themes/codeTheme"
import { styleTheme } from "shared/extensions/baseTheme"
import { enhanceCompletion } from "shared/extensions/autocompletion"
import { languageExtension } from "shared/extensions/language"
@@ -60,7 +59,7 @@ const extensions = computed(() => [
langExtension.value,
bracketMatching(),
closeBrackets(),
isDark.value ? oneDark : smoothy,
isDark.value ? darkCodeTheme : lightCodeTheme,
autocompletion({
override: [enhanceCompletion(language), completeAnyWord],
}),