Skip to content

Commit bbaaa5a

Browse files
Revert changes to src/components/theme-toggle.tsx. Fixes #2060
1 parent 33ea45c commit bbaaa5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/docs/dark-mode.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,15 @@ Here's a simple example of how you can support light mode, dark mode, as well as
174174
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
175175
document.documentElement.classList.toggle(
176176
"dark",
177-
localStorage.currentTheme === "dark" ||
177+
localStorage.theme === "dark" ||
178178
(!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches),
179179
);
180180

181181
// Whenever the user explicitly chooses light mode
182-
localStorage.currentTheme = "light";
182+
localStorage.theme = "light";
183183

184184
// Whenever the user explicitly chooses dark mode
185-
localStorage.currentTheme = "dark";
185+
localStorage.theme = "dark";
186186

187187
// Whenever the user explicitly chooses to respect the OS preference
188188
localStorage.removeItem("theme");

0 commit comments

Comments
 (0)