support change theme

This commit is contained in:
MaysWind
2023-06-23 01:24:10 +08:00
parent a05f6fb6b5
commit 651a912498
3 changed files with 59 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
export function getSystemTheme() {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
} else {
return 'light';
}
}