feat(public): add setting dark or light mode
This commit is contained in:
No files matched your search
@@ -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>
|
||||
Reference in New Issue
Block a user