@elmethis/qwik 0.0.20 → 0.0.21
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/lib/index.qwik.cjs +11 -6
- package/lib/index.qwik.mjs +11 -6
- package/package.json +1 -1
package/lib/index.qwik.cjs
CHANGED
|
@@ -1085,13 +1085,18 @@ function useElmethisTheme() {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
}));
|
|
1087
1087
|
qwik.useVisibleTask$(() => {
|
|
1088
|
-
const
|
|
1089
|
-
if (
|
|
1090
|
-
isDarkTheme.value =
|
|
1088
|
+
const localStorageTheme = localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
1089
|
+
if (localStorageTheme != null) {
|
|
1090
|
+
isDarkTheme.value = localStorageTheme === "dark";
|
|
1091
|
+
document.documentElement.setAttribute("data-theme", localStorageTheme);
|
|
1092
|
+
const body2 = document.querySelector("body");
|
|
1093
|
+
if (body2 != null) {
|
|
1094
|
+
body2.style.colorScheme = localStorageTheme;
|
|
1095
|
+
}
|
|
1091
1096
|
} else {
|
|
1092
|
-
const
|
|
1093
|
-
if (
|
|
1094
|
-
isDarkTheme.value =
|
|
1097
|
+
const currentTheme = document.documentElement.getAttribute("data-theme");
|
|
1098
|
+
if (currentTheme != null) {
|
|
1099
|
+
isDarkTheme.value = currentTheme === "dark";
|
|
1095
1100
|
}
|
|
1096
1101
|
}
|
|
1097
1102
|
}, {
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -1083,13 +1083,18 @@ function useElmethisTheme() {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
}));
|
|
1085
1085
|
useVisibleTask$(() => {
|
|
1086
|
-
const
|
|
1087
|
-
if (
|
|
1088
|
-
isDarkTheme.value =
|
|
1086
|
+
const localStorageTheme = localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
1087
|
+
if (localStorageTheme != null) {
|
|
1088
|
+
isDarkTheme.value = localStorageTheme === "dark";
|
|
1089
|
+
document.documentElement.setAttribute("data-theme", localStorageTheme);
|
|
1090
|
+
const body2 = document.querySelector("body");
|
|
1091
|
+
if (body2 != null) {
|
|
1092
|
+
body2.style.colorScheme = localStorageTheme;
|
|
1093
|
+
}
|
|
1089
1094
|
} else {
|
|
1090
|
-
const
|
|
1091
|
-
if (
|
|
1092
|
-
isDarkTheme.value =
|
|
1095
|
+
const currentTheme = document.documentElement.getAttribute("data-theme");
|
|
1096
|
+
if (currentTheme != null) {
|
|
1097
|
+
isDarkTheme.value = currentTheme === "dark";
|
|
1093
1098
|
}
|
|
1094
1099
|
}
|
|
1095
1100
|
}, {
|