🔍 Sitemap!

 Dark mode to protect your eyes
This commit is contained in:
2024-08-10 21:16:36 +08:00
parent 18af1ecde3
commit ad5aacce9c
11 changed files with 57 additions and 10 deletions

11
app.vue
View File

@@ -7,5 +7,16 @@
</template>
<script setup lang="ts">
import { useTheme } from "vuetify"
import "@unocss/reset/tailwind.css"
const theme = useTheme()
onMounted(() => {
theme.global.name.value = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", event => {
theme.global.name.value = event.matches ? "dark" : "light"
})
})
</script>