@@ -85,6 +85,35 @@ const { Content } = await render(post);
8585 </div >
8686
8787 <script is:inline >
88+ // Shared Mermaid config (keep in sync with src/scripts/mermaid-config.ts)
89+ const mermaidConfig = {
90+ startOnLoad: false,
91+ securityLevel: 'strict',
92+ theme: 'default',
93+ themeVariables: {
94+ primaryColor: '#eef2ff',
95+ primaryTextColor: '#1e1b4b',
96+ primaryBorderColor: '#a5b4fc',
97+ secondaryColor: '#f8fafc',
98+ secondaryTextColor: '#0f172a',
99+ secondaryBorderColor: '#e2e8f0',
100+ tertiaryColor: '#ffffff',
101+ tertiaryTextColor: '#0f172a',
102+ tertiaryBorderColor: '#cbd5e1',
103+ noteBkgColor: '#ffffff',
104+ noteTextColor: '#0f172a',
105+ noteBorderColor: '#e2e8f0',
106+ lineColor: '#64748b',
107+ textColor: '#0f172a',
108+ mainBkg: '#ffffff',
109+ secondBkg: '#f8fafc',
110+ border1: '#e2e8f0',
111+ border2: '#cbd5e1',
112+ arrowheadColor: '#64748b',
113+ fontFamily: 'system-ui, -apple-system, sans-serif',
114+ },
115+ };
116+
88117 // Inline version of renderMermaid for slides (scoped to specific element)
89118 async function renderMermaidInline(root = document) {
90119 const selectors = [
@@ -129,7 +158,7 @@ const { Content } = await render(post);
129158 const { default: mermaid } = await import(
130159 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs'
131160 );
132- mermaid.initialize({ startOnLoad: false, securityLevel: 'strict' } );
161+ mermaid.initialize(mermaidConfig );
133162
134163 const mermaidElements = root.querySelectorAll('.mermaid');
135164 if (mermaidElements.length > 0) {
@@ -257,23 +286,5 @@ const { Content } = await render(post);
257286 }
258287 });
259288 </script >
260-
261- <style is:global >
262- /* Mermaid diagram styles */
263- .mermaid {
264- display: flex;
265- justify-content: center;
266- margin: 2rem 0;
267- }
268- .mermaid svg {
269- display: block;
270- max-width: 100%;
271- height: auto;
272- }
273- .mermaid-loading {
274- opacity: 0;
275- min-height: 200px;
276- }
277- </style >
278289 </body >
279290</html >
0 commit comments