fix: rework setup to improve SSR compatibility

This commit is contained in:
Anthony Fu 2022-12-28 02:06:54 +01:00
parent fd7d30a38a
commit d8d163dbd0
22 changed files with 137 additions and 73 deletions

View file

@ -1,26 +0,0 @@
<script setup lang="ts">
function setDark(v: boolean) {
isDark.value = v
}
</script>
<template>
<div flex="~ gap4" w-full>
<button
btn-text flex-1 flex="~ gap-1 center" p4 border="~ base rounded" bg-base
:class="isDark ? 'pointer-events-none' : 'filter-saturate-0'"
@click="setDark(true)"
>
<div i-ri:moon-line />
Dark Mode
</button>
<button
btn-text flex-1 flex="~ gap-1 center" p4 border="~ base rounded" bg-base
:class="!isDark ? 'pointer-events-none' : 'filter-saturate-0'"
@click="setDark(false)"
>
<div i-ri:sun-line />
Light Mode
</button>
</div>
</template>