weifuwu 0.17.21 → 0.17.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react.js +2 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -544,13 +544,14 @@ function useLocale() {
|
|
|
544
544
|
|
|
545
545
|
// client-theme.ts
|
|
546
546
|
function resolveTheme(theme) {
|
|
547
|
-
if (theme === "system") {
|
|
547
|
+
if (theme === "system" && typeof window !== "undefined") {
|
|
548
548
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
549
549
|
}
|
|
550
550
|
return theme;
|
|
551
551
|
}
|
|
552
552
|
var _mqListener = null;
|
|
553
553
|
function applyTheme(theme) {
|
|
554
|
+
if (typeof document === "undefined") return;
|
|
554
555
|
const resolved = resolveTheme(theme);
|
|
555
556
|
document.documentElement.dataset.theme = resolved;
|
|
556
557
|
if (theme === "system") {
|