@@ -40,19 +40,31 @@ const vueUseVersions = computed(() => {
4040const vueUseVersionsSorted = useSorted (vueUseVersions , (a , b ) => semver .compare (b , a ))
4141
4242provide (' vueVersion' , vueVersion )
43+
44+ const colorMode = useColorMode ()
45+
46+ function toggleColorMode() {
47+ colorMode .value = colorMode .value === ' dark' ? ' light' : ' dark'
48+ }
4349 </script >
4450
4551<template >
4652 <UApp >
47- <UHeader >
48- <template # title >
53+ <header class = " flex items-center justify-around h-(--header-height) " >
54+ <div class = " flex gap-2 items-center " >
4955 <UIcon name =" i-logos-vueuse" class =" size-8" />VueUse Playground
50- </template >
51- <template #right >
56+ </div >
57+
58+ <div class =" flex gap-2 items-center" >
5259 <USelectMenu v-model =" vueUseVersion" :items =" vueUseVersionsSorted" class =" w-32" icon =" i-logos-vueuse" :loading =" loadingVersions" />
5360 <USelectMenu v-model =" vueVersion" :items =" vueVersionsSorted" class =" w-32" icon =" i-logos-vue" :loading =" loadingVersions" />
5461 <UButton icon =" i-lucide-refresh-ccw" size =" md" color =" primary" variant =" soft" @click =" fetchVersions" />
55- <UColorModeButton />
62+ <UButton
63+ color =" neutral" variant =" ghost"
64+ :icon =" colorMode.value === 'dark' ? 'i-heroicons-moon' : 'i-heroicons-sun'"
65+ aria-label =" color mode"
66+ @click =" toggleColorMode"
67+ />
5668
5769 <UTooltip text =" Open on GitHub" :kbds =" ['meta', 'G']" >
5870 <UButton
@@ -64,11 +76,11 @@ provide('vueVersion', vueVersion)
6476 aria-label =" GitHub"
6577 />
6678 </UTooltip >
67- </template >
68- </UHeader >
79+ </div >
80+ </header >
6981
70- <UMain class =" h-[calc(100vh-var(--ui -header-height))]" >
82+ <main class =" h-[calc(100vh-var(--header-height))]" >
7183 <NuxtPage />
72- </UMain >
84+ </main >
7385 </UApp >
7486</template >
0 commit comments