@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.
@@ -1085,13 +1085,18 @@ function useElmethisTheme() {
1085
1085
  }
1086
1086
  }));
1087
1087
  qwik.useVisibleTask$(() => {
1088
- const currentTheme = document.documentElement.getAttribute("data-theme");
1089
- if (currentTheme != null) {
1090
- isDarkTheme.value = currentTheme === "dark";
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 localStorageTheme = localStorage.getItem(LOCAL_STORAGE_KEY);
1093
- if (localStorageTheme != null) {
1094
- isDarkTheme.value = localStorageTheme === "dark";
1097
+ const currentTheme = document.documentElement.getAttribute("data-theme");
1098
+ if (currentTheme != null) {
1099
+ isDarkTheme.value = currentTheme === "dark";
1095
1100
  }
1096
1101
  }
1097
1102
  }, {
@@ -1083,13 +1083,18 @@ function useElmethisTheme() {
1083
1083
  }
1084
1084
  }));
1085
1085
  useVisibleTask$(() => {
1086
- const currentTheme = document.documentElement.getAttribute("data-theme");
1087
- if (currentTheme != null) {
1088
- isDarkTheme.value = currentTheme === "dark";
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 localStorageTheme = localStorage.getItem(LOCAL_STORAGE_KEY);
1091
- if (localStorageTheme != null) {
1092
- isDarkTheme.value = localStorageTheme === "dark";
1095
+ const currentTheme = document.documentElement.getAttribute("data-theme");
1096
+ if (currentTheme != null) {
1097
+ isDarkTheme.value = currentTheme === "dark";
1093
1098
  }
1094
1099
  }
1095
1100
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/qwik",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },