diff --git a/src/webview/newMicroPythonProjectPanel.mts b/src/webview/newMicroPythonProjectPanel.mts
index c050fe5b..b3f9d7a2 100644
--- a/src/webview/newMicroPythonProjectPanel.mts
+++ b/src/webview/newMicroPythonProjectPanel.mts
@@ -471,6 +471,12 @@ print("Finished.")\r\n`;
// Restrict the webview to only load specific scripts
const nonce = getNonce();
+ const defaultTheme =
+ window.activeColorTheme.kind === ColorThemeKind.Dark ||
+ window.activeColorTheme.kind === ColorThemeKind.HighContrast
+ ? "dark"
+ : "light";
+
return `
@@ -492,9 +498,12 @@ print("Finished.")\r\n`;
tailwind.config = {
darkMode: 'class',
};
+
+ localStorage.theme = "${defaultTheme}";
+
-
+
diff --git a/src/webview/newProjectPanel.mts b/src/webview/newProjectPanel.mts
index 974b5d44..ae12aacc 100644
--- a/src/webview/newProjectPanel.mts
+++ b/src/webview/newProjectPanel.mts
@@ -1491,6 +1491,13 @@ export class NewProjectPanel {
)
);
+ const defaultTheme =
+ window.activeColorTheme.kind === ColorThemeKind.Dark ||
+ window.activeColorTheme.kind === ColorThemeKind.HighContrast
+ ? "dark"
+ : "light";
+ const riscvDefaultSvgUri = defaultTheme === "dark" ? riscvWhiteSvgUri : riscvBlackSvgUri;
+
this._versionBundlesLoader = new VersionBundlesLoader(this._extensionUri);
// construct auxiliary html
@@ -1664,6 +1671,8 @@ export class NewProjectPanel {
var doProjectImport = ${this._isProjectImport};
var forceCreateFromExample = ${forceCreateFromExample};
+ localStorage.theme = "${defaultTheme}";
+
// riscv logos
const riscvWhiteSvgUri = "${riscvWhiteSvgUri.toString()}";
const riscvWhiteYellowSvgUri = "${riscvWhiteYellowSvgUri.toString()}";
@@ -1671,7 +1680,7 @@ export class NewProjectPanel {
const riscvColorSvgUri = "${riscvColorSvgUri.toString()}";
-
+
@@ -1796,7 +1805,7 @@ export class NewProjectPanel {