mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 04:14:30 +00:00
fix(webui): render theme-aware markdown code blocks in dark/light mode
This commit is contained in:
@@ -184,7 +184,7 @@ export function ChatbotSidebar({ projectId, contextAssetId }: ChatbotSidebarProp
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
pre: ({ node, ...props }) => (
|
||||
<pre
|
||||
className="whitespace-pre-wrap break-all break-words bg-gray-100 p-4 rounded-md"
|
||||
className="whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm"
|
||||
{...props}
|
||||
/>
|
||||
),
|
||||
|
||||
@@ -167,3 +167,28 @@
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
display: none; /* Chrome, Safari and Opera */
|
||||
}
|
||||
|
||||
/* Style code blocks and inline code inside .prose (rendered markdown) */
|
||||
.prose pre {
|
||||
background-color: var(--muted);
|
||||
color: var(--foreground);
|
||||
padding: 1rem;
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.875em;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.prose code {
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
/* Style inline code (code not inside pre) */
|
||||
.prose :not(pre) > code {
|
||||
background-color: var(--muted);
|
||||
color: var(--foreground);
|
||||
padding: 0.15rem 0.3rem;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
@@ -123,3 +123,28 @@
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
|
||||
/* Style code blocks and inline code inside .prose (rendered markdown) */
|
||||
.prose pre {
|
||||
background-color: var(--muted);
|
||||
color: var(--foreground);
|
||||
padding: 1rem;
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.875em;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.prose code {
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
/* Style inline code (code not inside pre) */
|
||||
.prose :not(pre) > code {
|
||||
background-color: var(--muted);
|
||||
color: var(--foreground);
|
||||
padding: 0.15rem 0.3rem;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user