it-tools/src/stores/style.store.ts

14 lines
340 B
TypeScript
Raw Normal View History

import { useStorage, usePreferredDark } from '@vueuse/core';
2022-04-04 01:52:59 +02:00
import { defineStore } from 'pinia';
import type { Ref } from 'vue';
2022-04-04 01:52:59 +02:00
export const useStyleStore = defineStore('style', {
state: () => {
const isDark = usePreferredDark();
return {
isDarkTheme: useStorage('useDarkTheme', isDark) as Ref<boolean>,
};
},
});