fix(ui): refine dark code block styling

Remove stray borders, outlines, shadows, and token backgrounds from markdown code content in dark mode to avoid the visible white frame around code text.

Adjust code block body padding so code content sits closer to the block edge while staying visually aligned with the language label.
This commit is contained in:
JOJO 2026-06-07 02:57:58 +08:00
parent 8617304fd4
commit f383b0ec71

View File

@ -1429,7 +1429,7 @@ show-html:not([data-rendered='1'])[ratio='3:4'] {
.code-block-wrapper pre {
background: var(--theme-surface-strong) !important;
padding: 24px 28px 28px !important;
padding: 18px 20px 22px !important;
margin: 0 !important;
border-radius: 0 !important;
border: none !important;
@ -1451,6 +1451,8 @@ show-html:not([data-rendered='1'])[ratio='3:4'] {
.code-block-wrapper pre code {
background: transparent !important;
padding: 0 !important;
border: 0 !important;
box-shadow: none !important;
color: var(--claude-text);
font-family:
'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', 'Menlo', 'Monaco', 'Courier New',
@ -1464,6 +1466,20 @@ show-html:not([data-rendered='1'])[ratio='3:4'] {
animation: none !important; /* 避免被其他动画样式污染导致行距抖动 */
}
:root[data-theme='dark'] .code-block-wrapper pre,
:root[data-theme='dark'] .code-block-wrapper pre code,
:root[data-theme='dark'] .code-block-wrapper pre code span {
background: transparent !important;
border: 0 !important;
box-shadow: none !important;
outline: 0 !important;
text-shadow: none !important;
}
:root[data-theme='dark'] .code-block-wrapper pre {
background: var(--theme-surface-strong) !important;
}
.streaming-text {
display: block;
}