Skip to content

Commit

Permalink
chore: 修复暗色主题下文本颜色问题
Browse files Browse the repository at this point in the history
给输入和输出气泡添加了 css 类,用来处理在暗色主题下聊天气泡的文本颜色
  • Loading branch information
yilozt committed Mar 20, 2023
1 parent 19d9806 commit 14bd03a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
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
19 changes: 19 additions & 0 deletions src/views/chat/components/Message/style.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import url('/src/styles/lib/github-markdown.less');

.markdown-body {
background-color: transparent;
font-size: 14px;
Expand Down Expand Up @@ -55,10 +57,27 @@
}
}
}

}

html .markdown-body {

h1,h2,h3,h4 {
border: none;
}
}

html.dark {

/* 用户的输入始终使用亮色主题的 Markdown */
.request .markdown-body:extend(html .markdown-body) {
--color-canvas-default: #0d1117;
}

.reply .whitespace-pre-wrap {
color: var(--n-text-color);
}

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

0 comments on commit 14bd03a

Please sign in to comment.