Open Spica2 opened 4 years ago
You should import 'smelte/src/dark'
<script>
import Button from "smelte/src/components/Button"
import dark from "smelte/src/dark"
const darkMode = dark()
</script>
<Button bind:value={$darkMode}>toggle dark</Button>
<div class="transition p-10 my-10 bg-black dark:bg-white text-white dark:text-black">
I am a {$darkMode ? 'dark' : 'light'} div.
</div>
when I use
I get an error Uncaught ReferenceError: darkMode is not defined