summaryrefslogtreecommitdiff
path: root/layouts/default.vue
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/default.vue')
-rw-r--r--layouts/default.vue18
1 files changed, 17 insertions, 1 deletions
diff --git a/layouts/default.vue b/layouts/default.vue
index 128a9c6..c6e249f 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -1,8 +1,24 @@
<template>
- <div>
+ <div :class="$colorMode.preference">
<VHeader />
<main>
<Nuxt />
</main>
</div>
</template>
+
+<script>
+export default {
+ created() {
+ setTimeout(() => {
+ const dark = document.querySelector("#__layout .dark");
+ console.log(dark);
+ if (dark) {
+ document.querySelector("body").className = "dark";
+ } else {
+ document.querySelector("body").className = "";
+ }
+ }, 1000);
+ },
+};
+</script>