-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from 2077-Collective/refactor/dark-mode-improv…
…ements refactor: dark mode improvements
- Loading branch information
Showing
10 changed files
with
101 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import { toggleTheme, theme } from '../stores/theme.store' | ||
import Sun from './icons/Sun.svelte' | ||
import Moon from './icons/Moon.svelte' | ||
import { beforeUpdate } from 'svelte' | ||
beforeUpdate(() => { | ||
const theme = localStorage.getItem('theme') | ||
if (theme === 'dark') { | ||
document.documentElement.classList.add('dark') | ||
} else { | ||
document.documentElement.classList.remove('dark') | ||
} | ||
}) | ||
</script> | ||
|
||
<button | ||
id="btn" | ||
class="rounded-lg p-2 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center justify-center" | ||
on:click={toggleTheme} | ||
> | ||
{#if $theme === 'dark'} | ||
<Sun /> | ||
{:else} | ||
<Moon /> | ||
{/if} | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
<svg | ||
class="" | ||
class="text-current" | ||
width="28" | ||
height="18" | ||
viewBox="0 0 28 18" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<rect class="" width="28" height="2" rx="1" fill="#1b1b1b"></rect> | ||
<rect y="8" width="28" height="2" rx="1" fill="#1b1b1b"></rect> | ||
<rect x="8" y="16" width="20" height="2" rx="1" fill="#1b1b1b"></rect> | ||
<rect class="text-current" width="28" height="2" rx="1" fill="currentColor" | ||
></rect> | ||
<rect | ||
class="text-current" | ||
y="8" | ||
width="28" | ||
height="2" | ||
rx="1" | ||
fill="currentColor" | ||
></rect> | ||
<rect | ||
class="text-current" | ||
x="8" | ||
y="16" | ||
width="20" | ||
height="2" | ||
rx="1" | ||
fill="currentColor" | ||
></rect> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters