From 2eab7663d15f96e4718afc0718bc8cb8797cbc8c Mon Sep 17 00:00:00 2001 From: isvishniakov Date: Tue, 16 Dec 2025 16:25:02 +0300 Subject: [PATCH] fix: options htmlToImage, styled background theme --- src/markmap/createMarkmap.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/markmap/createMarkmap.ts b/src/markmap/createMarkmap.ts index 1c6f28f..c72d6fc 100644 --- a/src/markmap/createMarkmap.ts +++ b/src/markmap/createMarkmap.ts @@ -245,11 +245,13 @@ export async function createMarkmap( } window.mm.fit().then(() => { + const isDarkMode = document.documentElement.classList.contains('markmap-dark'); + const options = { - backgroundColor: "#ffffff", - quality: 1.0, - width: node.getBoundingClientRect().width, - height: node.getBoundingClientRect().height + backgroundColor: isDarkMode ? "#27272a" : "#ffffff", + quality: 1.0, + width: node.getBoundingClientRect().width, + height: node.getBoundingClientRect().height }; const exportPromise = format === 'svg'