mode-watcher
Dark mode for SvelteKit.
What is mode-watcher
mode-watcher manages light/dark mode in SvelteKit without the flash of the wrong theme on load.
Install
npm install mode-watcherUsage
<script>
import { ModeWatcher, toggleMode } from 'mode-watcher';
</script>
<ModeWatcher />
<button onclick={toggleMode}>Toggle theme</button>Docs
Official documentation: mode-watcher.