☯ Dark Theme Manager for SvelteKit
Device'light'
$setting'sync'
$theme'light'
<!-- +layout.svelte --> <script> import { ThemeManager } from '@jill64/svelte-dark-theme' </script> <ThemeManager />
<script> import { theme } from '@jill64/svelte-dark-theme' // current theme is 'light' console.log($theme) // current setting is 'sync' console.log($setting) const change_to_dark = () => { $theme = 'dark' } </script>
// hooks.server.js import { onRender } from '@jill64/svelte-dark-theme' export const handle = onRender()