Skip to content

Commit

Permalink
feat: clickable label for theme switch
Browse files Browse the repository at this point in the history
  • Loading branch information
EATSTEAK committed Dec 9, 2023
1 parent 3f9f245 commit a63c759
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/LightSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ export const LightSwitch: Component<{}> = () => {
});
return (
<div class="flex items-center justify-start">
<label for="lightswitch" class="align-center font-mono hidden lg:inline">
<Show when={isDarkTheme()} fallback="LIGHT">
DARK
</Show>
</label>
<Switch
id="lightswitch"
enabled={isDarkTheme()}
onChange={(e) => setDarkTheme(e.target.checked)}
>
Expand All @@ -42,11 +48,6 @@ export const LightSwitch: Component<{}> = () => {
</Show>
</div>
</Switch>
<span class="align-center font-mono w-16">
<Show when={isDarkTheme()} fallback="LIGHT">
DARK
</Show>
</span>
</div>
);
};

0 comments on commit a63c759

Please sign in to comment.