From ae77cdfdc9dae4b42430902695ce816d0b4ac88f Mon Sep 17 00:00:00 2001 From: KawaiiZapic Date: Tue, 24 Sep 2024 13:06:29 +0800 Subject: [PATCH] fix: patch error in mermaid --- patches/mermaid@11.2.1.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/mermaid@11.2.1.patch b/patches/mermaid@11.2.1.patch index 6e9d1fc..e309fba 100644 --- a/patches/mermaid@11.2.1.patch +++ b/patches/mermaid@11.2.1.patch @@ -6,7 +6,7 @@ index 13603a2204ed75e59cdd3b59f1dad2a50a0ca1d3..946475ca2dc3522e669f56752b3e5cc1 const firstChild = svg.firstChild; const diagramClassDefs = diag.renderer.getClasses?.(text, diag); const rules = createUserStyles(config, diagramType, diagramClassDefs, idSelector); -+ const rulesDark = createUserStyles({...config2, themeVariables: theme.dark.getThemeVariables({})}, diagramType, diagramClassDefs, idSelector); ++ const rulesDark = createUserStyles({...config, themeVariables: theme.dark.getThemeVariables({})}, diagramType, diagramClassDefs, idSelector); const style1 = document.createElement("style"); - style1.innerHTML = rules; + style1.innerHTML = rules + `@media (prefers-color-scheme: dark) {${rulesDark}}`; @@ -21,7 +21,7 @@ index 2f09b512ef847144a4bcff16ab39853061f45eb4..bee36b4162e605eaa6a45f7506a40286 const firstChild = svg.firstChild; const diagramClassDefs = diag.renderer.getClasses?.(text, diag); const rules = createUserStyles(config, diagramType, diagramClassDefs, idSelector); -+ const rulesDark = createUserStyles({...config2, themeVariables: theme.dark.getThemeVariables({})}, diagramType, diagramClassDefs, idSelector); ++ const rulesDark = createUserStyles({...config, themeVariables: theme.dark.getThemeVariables({})}, diagramType, diagramClassDefs, idSelector); const style1 = document.createElement("style"); - style1.innerHTML = rules; + style1.innerHTML = rules + `@media (prefers-color-scheme: dark) {${rulesDark}}`; @@ -36,7 +36,7 @@ index 36adb8de5ea722a4c23798b47045faf08a8c7e4f..7f06dd6cfc71bb0b0cb8ac2c62fcc485 const firstChild = svg.firstChild; const diagramClassDefs = diag.renderer.getClasses?.(text2, diag); const rules = createUserStyles(config6, diagramType, diagramClassDefs, idSelector); -+ const rulesDark = createUserStyles({...config2, themeVariables: theme.dark.getThemeVariables({})}, diagramType, diagramClassDefs, idSelector); ++ const rulesDark = createUserStyles({...config6, themeVariables: theme.dark.getThemeVariables({})}, diagramType, diagramClassDefs, idSelector); const style1 = document.createElement("style"); - style1.innerHTML = rules; + style1.innerHTML = rules + `@media (prefers-color-scheme: dark) {${rulesDark}}`;