Skip to content

jill64/svelte-device-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@jill64/svelte-device-theme

npm-version npm-license npm-download-month npm-min-size

☯ A simple store that syncs with your device's theme settings

Usage

<script>
  import { isDark } from '@jill64/svelte-device-theme'
</script>

{#if $isDark}
  Device is dark mode
{:else}
  Device is light mode
{/if}

Note

$isDark is undefined on the server.
If you need full theme management including SSR, please see @jill64/svelte-dark-theme.

License

MIT