fix: undefined document in ssr

This commit is contained in:
Sagnik Pradhan
2021-10-19 14:46:18 -04:00
committed by Jean-Philippe Sirois
parent b6b295fced
commit c81d9246c4
2 changed files with 7 additions and 3 deletions
+2
View File
@@ -14,6 +14,8 @@ const ThemeScript = () => {
else return "dark"
}
if (typeof document === "undefined") return;
document.documentElement.style.setProperty(
"--initial-theme",
getInitialTheme()