Skip to content

Commit

Permalink
fix: tab navigation not working for theme toggle (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
lego-eden authored Nov 9, 2024
1 parent 9a7fbd3 commit 5c4f2af
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/routes/DarkLightToggle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@
};
</script>

<label class={twMerge("btn btn-ghost swap swap-rotate *:text-2xl", clazz)}>
<!-- this hidden checkbox controls the state -->
<input
type="checkbox"
bind:checked={isCurrentThemeLight}
on:click={toggleTheme}
/>

<button
class={twMerge("btn btn-ghost swap swap-rotate *:text-2xl", clazz)}
class:swap-active={isCurrentThemeLight}
on:click={toggleTheme}
>
<!-- moon icon -->
<span class="swap-on i-mdi-weather-night" />

<!-- sun icon -->
<span class="swap-off i-mdi-weather-sunny" />
</label>
</button>

0 comments on commit 5c4f2af

Please sign in to comment.