fixes serverside pb auth
This commit is contained in:
@@ -6,7 +6,10 @@ type Theme = "dark" | "light"
|
||||
export const theme: Writable<Theme> = writable(browser && localStorage.getItem("theme") as Theme || "light" );
|
||||
|
||||
export function toggleTheme() {
|
||||
const newTheme = get(theme) === "light" ? "dark" : "light";
|
||||
const currentTheme = get(theme);
|
||||
const newTheme = currentTheme === "light" ? "dark" : "light";
|
||||
document.documentElement.classList.remove(currentTheme)
|
||||
document.documentElement.classList.add(newTheme)
|
||||
theme.set(newTheme)
|
||||
localStorage.setItem("theme", newTheme);
|
||||
}
|
||||
Reference in New Issue
Block a user