fuma 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,20 @@
1
1
  <script lang="ts">
2
2
  import { browser } from '$app/environment'
3
3
  import { ModeWatcher, toggleMode, mode } from 'mode-watcher'
4
+ import { mdiWeatherNight, mdiWhiteBalanceSunny } from '@mdi/js'
4
5
 
5
6
  import { Icon } from '../icon/index.js'
6
- import { mdiWeatherNight, mdiWhiteBalanceSunny } from '@mdi/js'
7
+ import { onMount } from 'svelte'
7
8
 
8
9
  let klass = ''
9
10
  export { klass as class }
10
11
 
12
+ onMount(() => {
13
+ const [html] = document.getElementsByTagName('html')
14
+ if (!html || !$mode) return
15
+ html.setAttribute('data-theme', $mode)
16
+ })
17
+
11
18
  mode.subscribe((_mode) => {
12
19
  if (!browser) return
13
20
  const [html] = document.getElementsByTagName('html')
@@ -18,7 +25,7 @@
18
25
  $: path = $mode === 'light' ? mdiWhiteBalanceSunny : mdiWeatherNight
19
26
  </script>
20
27
 
21
- <ModeWatcher />
28
+ <ModeWatcher defaultMode="light" />
22
29
 
23
30
  <slot {toggleMode} {path}>
24
31
  <button class="btn btn-square btn-sm {klass}" on:click={toggleMode}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",