Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

fix:1541 system theme not working correctly (#1550)

Akshay6e1d539964f7
diff --git a/packages/monaco/src/code-editor.tsx b/packages/monaco/src/code-editor.tsx
index cb4acf83..64a48f0c 100644
--- a/packages/monaco/src/code-editor.tsx
+++ b/packages/monaco/src/code-editor.tsx
@@ -40,8 +40,8 @@ const DEFAULT_OPTIONS = {
export type CodeEditorProps = Omit<EditorProps, 'theme'>;
export function CodeEditor({ onChange, onMount, options, value, ...props }: CodeEditorProps) {
- const { theme } = useTheme();
- const editorTheme = theme === 'light' ? 'light' : 'vs-dark';
+ const { resolvedTheme } = useTheme();
+ const editorTheme = resolvedTheme === 'light' ? 'light' : 'vs-dark';
const { settings } = useEditorSettingsStore();
const editorOptions = useMemo(() => {
return {
diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsx
index 522167c7..ea00f8f5 100644
--- a/packages/ui/src/components/markdown.tsx
+++ b/packages/ui/src/components/markdown.tsx
@@ -53,8 +53,8 @@ export function Markdown({
disableMentions?: boolean;
disableCopy?: boolean;
}) {
- const { theme } = useTheme();
- const syntaxHighlighterTheme = theme === 'light' ? vs : vscDarkPlus;
+ const { resolvedTheme } = useTheme();
+ const syntaxHighlighterTheme = resolvedTheme === 'light' ? vs : vscDarkPlus;
return (
<ReactMarkdown