From 2aaa2e872f1bfb3e28459f11d6cd5c1df1f5ffb7 Mon Sep 17 00:00:00 2001 From: PetrLaskevic <139137582+PetrLaskevic@users.noreply.github.com> Date: Thu, 21 Aug 2025 20:04:28 +0200 Subject: [PATCH] fix: light background with dark diagram theme when downloading SVG ([#1777](https://github.com/mermaid-js/mermaid-live-editor/issues/1777)) --- src/lib/components/Actions.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/Actions.svelte b/src/lib/components/Actions.svelte index 578c98c4..d0f50739 100644 --- a/src/lib/components/Actions.svelte +++ b/src/lib/components/Actions.svelte @@ -45,6 +45,8 @@ svg = getSvgElement(); } + svg.style.backgroundColor = `hsl(${window.getComputedStyle(document.body).getPropertyValue('--background')})`; + const svgString = svg.outerHTML .replaceAll('
', '
') .replaceAll(/]*)>/g, (m, g: string) => ``);