We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e5ea2d commit 80f8358Copy full SHA for 80f8358
ui/src/components/ThemeToggle.vue
@@ -1,7 +1,13 @@
1
<script setup>
2
import { ref } from 'vue'
3
4
-const theme=ref(localStorage.getItem('data-theme'))
+function getCurrentTheme() {
5
+ let t = localStorage.getItem('data-theme')
6
+ if (t === null) return 'light'
7
+ return t
8
+}
9
+
10
+const theme=ref(getCurrentTheme())
11
document.documentElement.setAttribute("data-theme", theme.value);
12
13
function onThemeToggle(){
0 commit comments