Skip to content

Commit a9bb0e5

Browse files
committed
add default
1 parent 9247278 commit a9bb0e5

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/lib/themeUtils.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ export type Theme = {
1212
export const themes: Theme[] = [
1313
{
1414
id: "default",
15-
name: "IPython Default",
15+
name: "Default",
16+
colors: {
17+
primary: "#0D5C63", // ipython-blue
18+
secondary: "#008B95", // ipython-cyan
19+
accent: "#059669", // ipython-green
20+
},
21+
dotGradient: "linear-gradient(to bottom right, #0D5C63, #008B95, #059669)",
22+
},
23+
{
24+
id: "ipython-default",
25+
name: "Teal",
1626
colors: {
1727
primary: "#0D5C63", // ipython-blue
1828
secondary: "#008B95", // ipython-cyan
@@ -234,7 +244,8 @@ export function applyTheme(
234244
root.setAttribute("data-color-theme", actualThemeId);
235245

236246
// Store preference with date (store 'random' if that's what was selected)
237-
if (storePreference) {
247+
// Don't store if theme is 'default' (non-persistent default theme)
248+
if (storePreference && themeId !== "default") {
238249
const today = new Date();
239250
const dateString = `${today.getFullYear()}-${String(
240251
today.getMonth() + 1
@@ -244,6 +255,9 @@ export function applyTheme(
244255
date: dateString,
245256
};
246257
localStorage.setItem("colorTheme", JSON.stringify(storage));
258+
} else if (themeId === "default" && typeof localStorage !== "undefined") {
259+
// Remove any stored theme when switching to default
260+
localStorage.removeItem("colorTheme");
247261
}
248262
}
249263

0 commit comments

Comments
 (0)