From e2a05eae9725848c9186678627352f1e7a008df7 Mon Sep 17 00:00:00 2001 From: Lukas Bach Date: Fri, 23 Feb 2024 13:12:03 +0100 Subject: [PATCH] change darkmode detection --- src/mountCodeEditor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mountCodeEditor.ts b/src/mountCodeEditor.ts index 0537ecd..bccbf66 100644 --- a/src/mountCodeEditor.ts +++ b/src/mountCodeEditor.ts @@ -8,7 +8,9 @@ export const mountCodeEditor = ( onChange?: () => void ) => { let value = initialValue; - const theme = (app as any).getTheme() === "obsidian" ? "vs-dark" : "vs"; + const theme = document.body.classList.contains("theme-dark") + ? "vs-dark" + : "vs"; const queryParameters = new URLSearchParams(); queryParameters.append("context", codeContext);