Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
🩹 Fix a problem with the switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlurak committed Oct 31, 2023
1 parent 6cf1d8a commit 0d8968d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/lib/layout/launcher/launcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
};
showLauncher.subscribe((v) => {
console.log('Hello');
if (v) {
show = true;
} else {
Expand Down
8 changes: 6 additions & 2 deletions src/lib/utils/Switch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
const dispatch = createEventDispatcher();
</script>

<div bind:clientHeight={height} bind:clientWidth={width} class="w-14 h-7">
<div
bind:clientHeight={height}
bind:clientWidth={width}
class="w-14 h-7 switch-parent"
style="--parent-height: {height || 28}px; --parent-width: {width || 56}px;"
>
<input
type="checkbox"
role="switch"
bind:checked
style="--parent-height: {height}px; --parent-width: {width}px;"
class="appearance-none w-full h-full rounded-full relative bg-gray-400 dark:bg-gray-500 checked:bg-green-500 dark:checked:bg-green-400"
on:change={() => {
dispatch('change', checked);
Expand Down

0 comments on commit 0d8968d

Please sign in to comment.