-
Notifications
You must be signed in to change notification settings - Fork 1
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 #24 from crow-fox/features/darkmode
Features/darkmode
- Loading branch information
Showing
10 changed files
with
76 additions
and
22 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
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,38 @@ | ||
"use client"; | ||
|
||
import { useTheme } from "next-themes"; | ||
import { useId } from "react"; | ||
|
||
export function ThemeSelect() { | ||
const { theme, setTheme } = useTheme(); | ||
const uid = useId(); | ||
|
||
return ( | ||
<p> | ||
<label htmlFor={uid} className="sr-only"> | ||
カラーテーマを選択 | ||
</label> | ||
<span className="grid items-center "> | ||
<select | ||
id={uid} | ||
value={theme} | ||
onChange={(e) => setTheme(e.target.value)} | ||
className="inline-grid appearance-none rounded-lg border border-gray-900 py-2 pl-2 pr-6 text-base/none [grid-area:1/1] dark:border-gray-200 " | ||
> | ||
<option value="system">System</option> | ||
<option value="dark">Dark</option> | ||
<option value="light">Light</option> | ||
</select> | ||
<svg | ||
aria-hidden="true" | ||
height="24" | ||
viewBox="0 -960 960 960" | ||
width="24" | ||
className=" pointer-events-none mr-1 size-5 justify-self-end fill-current [grid-area:1/1]" | ||
> | ||
<path d="M480-360 280-560h400L480-360Z" /> | ||
</svg> | ||
</span> | ||
</p> | ||
); | ||
} |
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