feat(public): add setting dark or light mode

This commit is contained in:
riefive
2025-09-16 12:34:37 +07:00
parent 746e16ebe8
commit e02360aea5
3 changed files with 52 additions and 3 deletions

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
<script setup lang="ts">
import { useTheme } from '~/composables/useTheme'
const { theme, toggleTheme } = useTheme()
</script>
<template>
<button
@click="toggleTheme"
class="ml-2 flex items-center rounded border px-2 py-1"
:title="theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'"
>
<span v-if="theme === 'dark'"><Icon name="i-lucide-moon" class="h-4 w-4" /></span>
<span v-else><Icon name="i-lucide-sun" class="h-4 w-4" /></span>
</button>
</template>