Skip to content

Commit

Permalink
chore: 修复暗色主题下文本颜色问题
Browse files Browse the repository at this point in the history
* 给输入和输出气泡添加了 css 类
* 修改 src/style/lib/github-markdown.less 使用更加严格的选择器
  • Loading branch information
yilozt committed Mar 20, 2023
1 parent 19d9806 commit 11b1da5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/styles/lib/github-markdown.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
html.dark {
.markdown-body {
html.dark .reply .markdown-body {
color-scheme: dark;
--color-prettylights-syntax-comment: #8b949e;
--color-prettylights-syntax-constant: #79c0ff;
Expand Down Expand Up @@ -43,11 +42,10 @@ html.dark {
--color-accent-emphasis: #1f6feb;
--color-attention-subtle: rgba(187,128,9,0.15);
--color-danger-fg: #f85149;
}
}

html {
.markdown-body {
html .markdown-body,
html.dark .request .markdown-body {
color-scheme: light;
--color-prettylights-syntax-comment: #6e7781;
--color-prettylights-syntax-constant: #0550ae;
Expand Down Expand Up @@ -91,7 +89,6 @@ html {
--color-accent-emphasis: #0969da;
--color-attention-subtle: #fff8c5;
--color-danger-fg: #cf222e;
}
}

.markdown-body {
Expand Down
1 change: 1 addition & 0 deletions src/views/chat/components/Message/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const wrapClass = computed(() => {
isMobile.value ? 'p-2' : 'px-3 py-2',
props.inversion ? 'bg-[#d2f9d1]' : 'bg-[#f4f6f8]',
props.inversion ? 'dark:bg-[#a1dc95]' : 'dark:bg-[#1e1e20]',
props.inversion ? 'request' : 'reply',
{ 'text-red-500': props.error },
]
})
Expand Down
4 changes: 4 additions & 0 deletions src/views/chat/components/Message/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@

html.dark {

div .reply {
color: var(--n-text-color);
}

.highlight pre,
pre {
background-color: #282c34;
Expand Down

0 comments on commit 11b1da5

Please sign in to comment.