@@ -5,7 +5,11 @@ import {
55 onCleanup ,
66 onMount ,
77} from "solid-js" ;
8- import { MarkdownRenderer , type Themes } from "solid-markdown-wasm" ;
8+ import {
9+ DEFAULT_MERMAID_CONFIG ,
10+ MarkdownRenderer ,
11+ type Themes ,
12+ } from "solid-markdown-wasm" ;
913import { MonacoEditor } from "solid-monaco" ;
1014import haxiomLogo from "../src/assets/haxiom.svg" ;
1115import initialMarkdown from "../src/assets/markdown_preview.md?raw" ;
@@ -153,6 +157,7 @@ const App: Component = () => {
153157 return (
154158 < div
155159 class = "flex flex-col w-screen h-screen"
160+ data-theme = { isDarkMode ( ) ? "dark" : "light" }
156161 classList = { { "bg-[#1e1e1e]" : isDarkMode ( ) , "bg-white" : ! isDarkMode ( ) } }
157162 >
158163 { /* Toolbar */ }
@@ -267,8 +272,7 @@ const App: Component = () => {
267272 href = "https://haxiom.io"
268273 target = "_blank"
269274 rel = "noopener noreferrer"
270- class = "text-sm font-medium px-3 py-1.5 rounded transition-colors text-black hover:opacity-80"
271- style = { { "background-color" : "#6fffe9" } }
275+ class = "text-sm font-medium px-3 py-1.5 rounded transition-colors hover:opacity-80 bg-(--haxiom-accent-color) text-(--haxiom-fg-color)"
272276 >
273277 Try Haxiom
274278 </ a >
@@ -302,6 +306,27 @@ const App: Component = () => {
302306 fallback = { < LoadingFallback /> }
303307 onLoaded = { ( ) => console . log ( "WASM Loaded" ) }
304308 immediateRenderMermaid = { immediateMermaid ( ) }
309+ mermaidConfig = { ( theme ) => {
310+ const isDark = theme === "dark" ;
311+ const textColor = isDark ? "#c9d1d9" : "#24292f" ;
312+ const nodeBkg = isDark ? "#BB2528" : "#fee2e2" ; // Dark red vs light red
313+ const nodeText = isDark ? "#ffffff" : "#991b1b" ; // White vs dark red
314+
315+ return {
316+ ...DEFAULT_MERMAID_CONFIG ( theme ) ,
317+ themeVariables : {
318+ ...DEFAULT_MERMAID_CONFIG ( theme ) . themeVariables ,
319+ primaryColor : nodeBkg ,
320+ nodeBkg : nodeBkg ,
321+ primaryTextColor : nodeText ,
322+ nodeTextColor : nodeText ,
323+ textColor : textColor ,
324+ lineColor : "#FF0000" ,
325+ secondaryColor : "#006100" ,
326+ tertiaryColor : isDark ? "#222222" : "#eeeeee" ,
327+ } ,
328+ } ;
329+ } }
305330 />
306331 </ div >
307332 </ div >
0 commit comments