add DarkMode with Button #51

Merged
jakob.scheid merged 7 commits from feature/dark-mode into main 2026-05-15 12:47:26 +02:00
Showing only changes of commit 67adb17936 - Show all commits
+4 -2
View File
@@ -17,9 +17,11 @@ limitations under the License.
<script setup> <script setup>
import Navbar from './features/nav/components/Navbar.vue'; import Navbar from './features/nav/components/Navbar.vue';
import Footer from './features/footer/components/Footer.vue'; import Footer from './features/footer/components/Footer.vue';
import { ref, provide } from 'vue'; import { ref, provide, watch } from 'vue';
const isDark = ref(false);
const isDark = ref(localStorage.getItem('theme') === 'dark');
provide('isDark', isDark); provide('isDark', isDark);
watch(isDark, val => localStorage.setItem('theme', val ? 'dark' : 'light'));
</script> </script>
<template> <template>