Skip to content

Commit

Permalink
fix: theme
Browse files Browse the repository at this point in the history
  • Loading branch information
cnwhy committed May 30, 2024
1 parent 2ad0fa5 commit 2cb8acf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/uitls/useTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2cb8acf

Please sign in to comment.