Skip to content

Commit

Permalink
chore: bump
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed May 11, 2024
1 parent 6fac6e0 commit 0fc4937
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
},
"dependencies": {
"@varlet/axle": "^0.7.1",
"@varlet/touch-emulator": "^3.2.7",
"@varlet/ui": "^3.2.7",
"@varlet/use": "^3.2.7",
"@varlet/touch-emulator": "^3.2.9",
"@varlet/ui": "^3.2.9",
"@varlet/use": "^3.2.9",
"dayjs": "^1.11.8",
"pinia": "^2.1.3",
"vue": "^3.4.21",
Expand All @@ -44,7 +44,7 @@
"@typescript-eslint/parser": "^5.59.8",
"@unocss/preset-rem-to-px": "^0.58.2",
"@varlet/icon-builder": "^0.0.3",
"@varlet/import-resolver": "^3.2.7",
"@varlet/import-resolver": "^3.2.9",
"@varlet/preset-unocss": "3.1.3",
"@vitejs/plugin-vue": "^5.0.0",
"@vitejs/plugin-vue-jsx": "^3.1.0",
Expand Down
50 changes: 25 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/use/useDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export function useDark() {
const isDark = ref(saved || (saved == null && window.matchMedia('(prefers-color-scheme: dark)').matches))

function updateTheme() {
localStorage.set('prefer-dark', isDark.value)
StyleProvider(isDark.value ? darkTheme : lightTheme)
document.documentElement.style.setProperty('color-scheme', isDark.value ? 'dark' : 'light')
}

function toggleDark() {
isDark.value = !isDark.value
localStorage.set('prefer-dark', isDark.value)
updateTheme()
}

Expand Down

0 comments on commit 0fc4937

Please sign in to comment.