feat: use nuxt 4 structure
This commit is contained in:
18 files changed
+7
-3
No files matched your search
@@ -0,0 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
const color = useColorMode()
|
||||
|
||||
useHead({
|
||||
meta: [{
|
||||
id: 'theme-color',
|
||||
name: 'theme-color',
|
||||
content: () => color.value === 'dark' ? '#222222' : '#ffffff',
|
||||
}],
|
||||
})
|
||||
|
||||
function toggleDark() {
|
||||
color.preference = color.value === 'dark' ? 'light' : 'dark'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button class="!outline-none" @click="toggleDark">
|
||||
<div class="i-carbon-sun dark:i-carbon-moon" />
|
||||
</button>
|
||||
</template>
|
||||
Reference in new issue
Block a user