From a7aab01f051487327e5ce52b6a8905208c546e8c Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 15:49:44 +0800 Subject: [变更性质] feat(frontend) [新增功能] 12 页面组件全量 shadcn:Card/Button/Table/Tabs/Select/Alert;375 底部 Tab Bar 改用 Tabs 组件实现 [实现方案] 页面级手写 class 全部移除(.btn/.banner/table.data/.badge/.tabs/.metric-row/.m-tile/.hint 等改为 shadcn + tailwind 工具类);Modal/DatasetWizard/DatasetCard/DiffView/CodeEditor/Status/Layout 同步 [影响范围] src/pages/*.svelte、src/components/*.svelte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/CodeEditor.svelte | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'frontend/src/components/CodeEditor.svelte') diff --git a/frontend/src/components/CodeEditor.svelte b/frontend/src/components/CodeEditor.svelte index 544a6a4..da11555 100644 --- a/frontend/src/components/CodeEditor.svelte +++ b/frontend/src/components/CodeEditor.svelte @@ -15,6 +15,7 @@ } let { value, onInput, height = 420, readOnly = false, label }: Props = $props(); + const hostClass = 'rounded-md border border-border overflow-hidden bg-card [&>.cm-editor]:min-h-[60px]'; let host: HTMLDivElement; let view: EditorView | null = null; let applyingExternal = false; @@ -41,8 +42,8 @@ EditorView.theme({ '&': { fontSize: '13px', - background: 'var(--surface)', - color: 'var(--text)', + background: 'var(--card)', + color: 'var(--foreground)', fontFamily: "ui-monospace, 'SF Mono', Menlo, Consolas, 'Noto Sans Mono CJK SC', monospace" }, @@ -50,12 +51,12 @@ '.cm-scroller': { lineHeight: '1.55' }, '&.cm-focused': { outline: 'none' }, '.cm-gutters': { - background: 'var(--surface)', + background: 'var(--card)', border: 'none', - color: 'var(--text-3)' + color: 'var(--muted-foreground)' }, - '.cm-activeLine': { background: 'var(--surface-2)' }, - '.cm-activeLineGutter': { background: 'var(--surface-2)' } + '.cm-activeLine': { background: 'var(--secondary)' }, + '.cm-activeLineGutter': { background: 'var(--secondary)' } }), EditorView.updateListener.of((u) => { if (applyingExternal) return; @@ -88,17 +89,7 @@
- {#if label}{label}{/if} -
+ {#if label}{label}{/if} +
- -- cgit v1.2.3