fix: theme

This commit is contained in:
cnwhy
2024-05-31 01:12:29 +08:00
parent 2ef6d93601
commit 4fa8655a0e
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -4,10 +4,12 @@
font-weight: 400;
color-scheme: light dark;
font-synthesis: none;
background-color: #FFF;
/* text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%; */
transition: all .5s;
}
:root.theme-dark {
+2 -1
View File
@@ -22,7 +22,8 @@ export const useIsDark = ()=> {
const sysIsDark = useSysIsDark();
const { theme: userTheme } = useSettings();
const isDark = useMemo(() => {
if (userTheme === "system") {
console.log('useIsDark')
if (!userTheme || userTheme === "system") {
return sysIsDark;
} else {
return userTheme === "dark" ? true : false;