diff options
author | Santo Cariotti <santo@dcariotti.me> | 2022-09-27 19:17:51 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-27 19:17:51 +0200 |
commit | 6395d1ec4362fedd7854fc9a103bad8bf7ae5d3d (patch) | |
tree | 93a2d01ec76ef5b78e36d3f5f2ad284d1286d928 /layouts | |
parent | 74f689fefb77328f22772bbdf9ebc6aefb01cdab (diff) |
Dark mode
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/default.vue | 18 |
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> |