From c960cb901be70adae8d010385ac57fcf032cd0a9 Mon Sep 17 00:00:00 2001 From: Abhijay007 Date: Tue, 16 Sep 2025 14:39:45 +0000 Subject: [PATCH] fix: improve oneDark theme for comment contrast and readability Signed-off-by: Abhijay007 --- ui/desktop/src/components/MarkdownContent.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ui/desktop/src/components/MarkdownContent.tsx b/ui/desktop/src/components/MarkdownContent.tsx index a8bb679b3516..ff10ebe8b848 100644 --- a/ui/desktop/src/components/MarkdownContent.tsx +++ b/ui/desktop/src/components/MarkdownContent.tsx @@ -4,6 +4,25 @@ import remarkGfm from 'remark-gfm'; import remarkBreaks from 'remark-breaks'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism'; +// Improved oneDark theme for better comment contrast and readability +const customOneDarkTheme = { + ...oneDark, + 'code[class*="language-"]': { + ...oneDark['code[class*="language-"]'], + color: '#e6e6e6', + fontSize: '14px', + }, + 'pre[class*="language-"]': { + ...oneDark['pre[class*="language-"]'], + color: '#e6e6e6', + fontSize: '14px', + }, + comment: { ...oneDark.comment, color: '#a0a0a0', fontStyle: 'italic' }, + prolog: { ...oneDark.prolog, color: '#a0a0a0' }, + doctype: { ...oneDark.doctype, color: '#a0a0a0' }, + cdata: { ...oneDark.cdata, color: '#a0a0a0' }, +}; + import { Check, Copy } from './icons'; import { wrapHTMLInCodeBlock } from '../utils/htmlSecurity'; @@ -62,7 +81,7 @@ const CodeBlock = memo(function CodeBlock({ return (