@the-portland-company/shell 0.67.0 → 0.68.0

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/index.cjs CHANGED
@@ -1194,6 +1194,15 @@ function readThemeCookie() {
1194
1194
  }
1195
1195
  }
1196
1196
  function resolveTheme(pref) {
1197
+ if (pref === "dark") return "dark";
1198
+ if (pref === "system") {
1199
+ try {
1200
+ if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
1201
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1202
+ }
1203
+ } catch {
1204
+ }
1205
+ }
1197
1206
  return "light";
1198
1207
  }
1199
1208
  function readStoredThemePreference() {
@@ -1218,11 +1227,10 @@ var ls=null;try{ls=localStorage.getItem(KEY);}catch(e){}
1218
1227
  var pref=cookie||ls||"system";
1219
1228
  if(VALID.indexOf(pref)===-1)pref="system";
1220
1229
  if(cookie&&cookie!==ls){try{localStorage.setItem(KEY,cookie);}catch(e){}}
1221
- // Dark Mode retired platform-wide 2026-09-21 \u2014 always light, and strip any
1222
- // stale dark class a pre-retirement cookie/localStorage value left behind.
1230
+ var dark=pref==="dark"||(pref==="system"&&!!(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches));
1223
1231
  var d=document.documentElement;
1224
- d.classList.remove("dark");
1225
- try{d.style.colorScheme="light";}catch(e){}
1232
+ if(dark)d.classList.add("dark");else d.classList.remove("dark");
1233
+ try{d.setAttribute("data-theme",dark?"dark":"light");d.style.colorScheme=dark?"dark":"light";}catch(e){}
1226
1234
  }catch(e){}})();`;
1227
1235
 
1228
1236
  // src/theme/colorMode.tsx