Feat(webui): improve code block readability in dark mode(iss#6963) (#7014)

* Feat(webui): improve code block readability in dark mode

* fix(dashboard): use theme variable for code text

---------

Co-authored-by: RC-CHN <1051989940@qq.com>
This commit is contained in:
M1LKT
2026-03-26 23:34:33 +08:00
committed by GitHub
parent 22e24e5f7b
commit 6db9aef3ea
2 changed files with 9 additions and 0 deletions

View File

@@ -39,3 +39,10 @@ html {
transform: rotate(270deg);
}
}
pre, code, .markdown pre, .markdown code, .release-notes pre, .release-notes code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Helvetica Neue", monospace;
color: var(--astrbot-code-color);
}

View File

@@ -11,10 +11,12 @@ $font-size-root: 1rem;
$border-radius-root: 8px;
$cjk-sans-fallback: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Microsoft YaHei' !default;
$cjk-mono-fallback: 'PingFang SC', 'PingFang TC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Microsoft YaHei' !default;
$code-text-color: #111827 !default;
:root {
--astrbot-font-cjk-sans: #{$cjk-sans-fallback};
--astrbot-font-cjk-mono: #{$cjk-mono-fallback};
--astrbot-code-color: #{$code-text-color};
}
$body-font-family: 'Roboto', $cjk-sans-fallback, sans-serif !default;