@henriquepetrelli/hp-design-system 1.1.16 → 1.1.17

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.
@@ -1427,18 +1427,11 @@
1427
1427
 
1428
1428
  const emit = __emit;
1429
1429
 
1430
- const isDarkMode = vue.ref(
1431
- typeof window !== 'undefined' && localStorage.getItem('theme') === 'dark'
1432
- );
1430
+ const isDarkMode = vue.ref(localStorage.getItem('theme') === 'dark');
1433
1431
 
1434
1432
  const applyTheme = (isDark) => {
1435
- if (typeof document === 'undefined') return
1436
-
1437
1433
  const theme = isDark ? 'dark' : 'light';
1438
-
1439
- document.documentElement.classList.remove('dark', 'light');
1440
- document.documentElement.classList.add(theme);
1441
-
1434
+ document.documentElement.setAttribute('data-theme', theme);
1442
1435
  localStorage.setItem('theme', theme);
1443
1436
  };
1444
1437
 
@@ -1452,6 +1445,10 @@
1452
1445
  toggleTheme();
1453
1446
  };
1454
1447
 
1448
+ vue.onMounted(() => {
1449
+ applyTheme(isDarkMode.value);
1450
+ });
1451
+
1455
1452
  vue.watch(
1456
1453
  () => props.modelValue,
1457
1454
  (value) => {
@@ -1514,7 +1511,7 @@
1514
1511
  }
1515
1512
 
1516
1513
  };
1517
- const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-ba2225dd"]]);
1514
+ const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-8b3eb905"]]);
1518
1515
 
1519
1516
  const _hoisted_1$3 = { class: "input__fieldset" };
1520
1517
  const _hoisted_2$3 = {