Skip to content

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

fix: Dark mode profile bio wrong theme colors (#783)

Srinivasa IK Varanasic4ba2cce6a47
diff --git a/apps/web/src/components/rich-markdown-editor.tsx b/apps/web/src/components/rich-markdown-editor.tsx
index c7dcb096..92d44188 100644
--- a/apps/web/src/components/rich-markdown-editor.tsx
+++ b/apps/web/src/components/rich-markdown-editor.tsx
@@ -38,9 +38,22 @@ export function RichMarkdownEditor({
const { theme } = useTheme();
useEffect(() => {
- theme === 'dark'
- ? document.documentElement.setAttribute('data-color-mode', 'dark')
- : document.documentElement.setAttribute('data-color-mode', 'light');
+ switch (theme) {
+ case 'dark': {
+ document.documentElement.setAttribute('data-color-mode', 'dark');
+ break;
+ }
+
+ case 'light': {
+ document.documentElement.setAttribute('data-color-mode', 'light');
+ break;
+ }
+
+ default: {
+ document.documentElement.setAttribute('data-color-mode', 'system');
+ break;
+ }
+ }
}, [theme]);
const extraCommands = [...(dismissPreview ? [] : [codePreview, commands.fullscreen])];