Files
vue-template/src/components/ThemeToggle.vue
T
siujamo 0b1c394cfd feat: initialise Vue 3 SPA template
- Add Tailwind CSS v4 with light/dark theme support
- Add layout system (default, sidebar, blank)
- Add mock authentication with Pinia store and route guards
- Add error pages (404, 500) and example views
- Add Vitest with 10 example tests across stores
- Configure Prettier formatting and ESLint linting
2026-06-18 16:38:51 +08:00

17 lines
525 B
Vue
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { useTheme } from "@/stores/theme"
const { mode, toggle } = useTheme()
</script>
<template>
<button
type="button"
class="cursor-pointer rounded-md border border-border bg-surface-alt p-2 text-foreground hover:bg-border transition-colours"
:aria-label="mode === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'"
@click="toggle">
<span v-if="mode === 'dark'" aria-hidden="true"></span>
<span v-else aria-hidden="true">🌙</span>
</button>
</template>