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