diff --git a/webui2/src/components/code/file-viewer.tsx b/webui2/src/components/code/file-viewer.tsx index 97bcb569b8af5fa6aacd3d42c2c02a71d607cc1a..85a6bf88224a75e1aba846d7691eb17c14f1911b 100644 --- a/webui2/src/components/code/file-viewer.tsx +++ b/webui2/src/components/code/file-viewer.tsx @@ -223,6 +223,7 @@ export function FileViewer({ blob }: FileViewerProps) { const hast = highlighter.codeToHast(blob.text!, { lang, themes: { light: "github-light", dark: "github-dark" }, + defaultColor: false, transformers: [lineNumberTransformer()], }); diff --git a/webui2/src/index.css b/webui2/src/index.css index 59bbe507ebaa52c527b87e3a181c185dd5b6bf7d..bad2964cb54d8729db450efbb063d965109ddeeb 100644 --- a/webui2/src/index.css +++ b/webui2/src/index.css @@ -111,13 +111,22 @@ body { color: var(--foreground); } -/* ── Shiki dual-theme: swap to dark variables when .dark is active ───────── */ +/* ── Shiki dual-theme (defaultColor: false) ──────────────────────────────── */ +.shiki, +.shiki span { + color: var(--shiki-light); + background-color: var(--shiki-light-bg); + font-style: var(--shiki-light-font-style); + font-weight: var(--shiki-light-font-weight); + text-decoration: var(--shiki-light-text-decoration); +} + .dark .shiki, .dark .shiki span { - color: var(--shiki-dark) !important; - background-color: var(--shiki-dark-bg) !important; - font-style: var(--shiki-dark-font-style) !important; - font-weight: var(--shiki-dark-font-weight) !important; - text-decoration: var(--shiki-dark-text-decoration) !important; + color: var(--shiki-dark); + background-color: var(--shiki-dark-bg); + font-style: var(--shiki-dark-font-style); + font-weight: var(--shiki-dark-font-weight); + text-decoration: var(--shiki-dark-text-decoration); }