Create centralized theme management with useTheme composable

- Extract theme initialization logic from main.ts into useTheme composable
- Add setTheme() and initTheme() functions for consistent theme handling
- Update ThemePreferences to use useTheme instead of duplicate logic
- Remove unused DarkmodeToggle component
- Clean up main.ts from ~49 to 28 lines (theme logic now in composable)
- Establish single source of truth for theme management
- Follow Vue 3 composables pattern for better organization and testability
This commit is contained in:
2026-03-08 20:56:54 +01:00
parent e8a0598e8f
commit 493ac02bab
4 changed files with 58 additions and 81 deletions

View File

@@ -13,8 +13,6 @@
<!-- Popup that will show above existing rendered content -->
<popup />
<darkmode-toggle />
<!-- Command Palette -->
<command-palette />
</div>
@@ -25,7 +23,6 @@
import NavigationHeader from "@/components/header/NavigationHeader.vue";
import NavigationIcons from "@/components/header/NavigationIcons.vue";
import Popup from "@/components/Popup.vue";
import DarkmodeToggle from "@/components/ui/DarkmodeToggle.vue";
import CommandPalette from "@/components/ui/CommandPalette.vue";
const router = useRouter();