diff --git a/web/src/assets/css/base.dark.css b/web/src/assets/css/base.dark.css index bbd6ed25..825c69b6 100644 --- a/web/src/assets/css/base.dark.css +++ b/web/src/assets/css/base.dark.css @@ -131,5 +131,5 @@ } :root.dark .md-editor { - --md-bk-color: var(--gray-0); + --md-bk-color: transparent; } diff --git a/web/src/assets/css/main.css b/web/src/assets/css/main.css index 527baf6f..3b444c8a 100644 --- a/web/src/assets/css/main.css +++ b/web/src/assets/css/main.css @@ -3,6 +3,7 @@ @import './sigma.css'; @import './shorts.css'; @import './dashboard.css'; +@import './markdown-preview.less'; :root { --header-height: 45px; diff --git a/web/src/assets/css/markdown-preview.less b/web/src/assets/css/markdown-preview.less new file mode 100644 index 00000000..9708fbd2 --- /dev/null +++ b/web/src/assets/css/markdown-preview.less @@ -0,0 +1,59 @@ +// MdPreview 统一样式覆盖 - 扁平化风格 + +.flat-md-preview { + .md-editor { + background: transparent; + } + .md-editor-preview-wrapper { + padding: 0; + } + + .md-editor-preview { + font-size: 14px; + line-height: 1.75; + color: var(--gray-1000); + + h1 { + font-size: 1.2rem; + margin: 16px 0 12px; + font-weight: 600; + } + + h2 { + font-size: 1.15rem; + margin: 16px 0 12px; + font-weight: 600; + } + + h3 { + font-size: 1.1rem; + margin: 14px 0 10px; + font-weight: 600; + } + + h4 { + font-size: 1rem; + margin: 14px 0 10px; + font-weight: 600; + } + + h5 { + font-size: 1rem; + margin: 12px 0 8px; + font-weight: 600; + } + + h6 { + font-size: 1rem; + margin: 12px 0 8px; + font-weight: 600; + } + } +} + +// 背景透明场景 +.flat-md-preview--transparent { + .md-editor { + background: transparent; + } +} diff --git a/web/src/components/AgentPanel.vue b/web/src/components/AgentPanel.vue index 7d1385b7..476b28b4 100644 --- a/web/src/components/AgentPanel.vue +++ b/web/src/components/AgentPanel.vue @@ -114,7 +114,7 @@ -
+
diff --git a/web/src/components/sources/KbChunkDetailModal.vue b/web/src/components/sources/KbChunkDetailModal.vue index 235131c3..d1626618 100644 --- a/web/src/components/sources/KbChunkDetailModal.vue +++ b/web/src/components/sources/KbChunkDetailModal.vue @@ -20,7 +20,7 @@ :modelValue="chunk.content" :theme="theme" previewTheme="github" - class="chunk-markdown-content" + class="chunk-markdown-content flat-md-preview" />
暂无内容
@@ -85,10 +85,6 @@ const modalTitle = computed(() => { background: transparent; } -.chunk-markdown-content :deep(.md-editor-preview-wrapper) { - padding: 0; -} - .empty-text { color: var(--gray-500); font-size: 13px; diff --git a/web/src/components/sources/KbResultGroupedList.vue b/web/src/components/sources/KbResultGroupedList.vue index 579d4b1d..55ab5f2b 100644 --- a/web/src/components/sources/KbResultGroupedList.vue +++ b/web/src/components/sources/KbResultGroupedList.vue @@ -147,6 +147,7 @@ const openChunkDetail = (chunk, index) => {