Skip to content

Commit 6db9aef

Browse files
M1LKTRC-CHN
andauthored
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>
1 parent 22e24e5 commit 6db9aef

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

dashboard/src/scss/_override.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ html {
3939
transform: rotate(270deg);
4040
}
4141
}
42+
43+
pre, code, .markdown pre, .markdown code, .release-notes pre, .release-notes code {
44+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Helvetica Neue", monospace;
45+
color: var(--astrbot-code-color);
46+
}
47+
48+

dashboard/src/scss/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ $font-size-root: 1rem;
1111
$border-radius-root: 8px;
1212
$cjk-sans-fallback: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Microsoft YaHei' !default;
1313
$cjk-mono-fallback: 'PingFang SC', 'PingFang TC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Microsoft YaHei' !default;
14+
$code-text-color: #111827 !default;
1415

1516
:root {
1617
--astrbot-font-cjk-sans: #{$cjk-sans-fallback};
1718
--astrbot-font-cjk-mono: #{$cjk-mono-fallback};
19+
--astrbot-code-color: #{$code-text-color};
1820
}
1921

2022
$body-font-family: 'Roboto', $cjk-sans-fallback, sans-serif !default;

0 commit comments

Comments
 (0)