-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0154141
commit 3ccda61
Showing
4 changed files
with
22 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
<div x-data="{ | ||
toggle: () => { | ||
if (darkMode === 'dark') { | ||
darkMode = 'light'; | ||
} else { | ||
darkMode = 'dark'; | ||
} | ||
} | ||
}" @keydown.window.tab="toggle" | ||
{{ $attributes->merge(['class' => 'flex items-center justify-center space-x-2']) }}> | ||
<input id="theme-switcher" type="checkbox" name="switch" class="hidden" :checked="darkMode === 'dark'"> | ||
<div @keydown.window.tab="toggle" {{ $attributes->merge(['class' => 'flex items-center justify-center space-x-2']) }}> | ||
<input id="theme-switcher" type="checkbox" name="switch" class="hidden" :checked="$store.darkMode.on"> | ||
|
||
<button type="button" @click="toggle" | ||
<button type="button" @click="$store.darkMode.toggle()" | ||
class="inline-flex items-center justify-center rounded-md p-2 text-gray-400 transition duration-150 ease-in-out hover:bg-gray-100 hover:text-gray-500 focus:outline-none dark:hover:bg-gray-700 dark:hover:text-gray-300"> | ||
<x-heroicon-o-moon class="h-5 w-5" x-show="darkMode === 'dark'" /> | ||
<x-heroicon-o-sun class="h-5 w-5" x-show="darkMode === 'light'" /> | ||
<x-heroicon-o-moon class="h-5 w-5" x-show="$store.darkMode.on" /> | ||
<x-heroicon-o-sun class="h-5 w-5" x-show="!$store.darkMode.on" /> | ||
</button> | ||
</div> |
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