1
0
Fork 0
mirror of https://github.com/CorentinTh/it-tools.git synced 2025-07-19 05:09:37 +02:00
it-tools/src/ui/theme/theme.models.ts
Seb cf7b1f000a
feat(enhancement): use system dark mode (#458)
* Use prefers-color-scheme

* Remove theme store
2023-06-18 10:59:22 +02:00

13 lines
327 B
TypeScript

import { useStyleStore } from '@/stores/style.store';
export { defineThemes };
function defineThemes<Theme>(themes: { light: Theme; dark: Theme }) {
return {
themes,
useTheme() {
const styleStore = useStyleStore();
return computed(() => themes[styleStore.isDarkTheme ? 'dark' : 'light']);
},
};
}