Skip to content

Commit 1e12229

Browse files
committed
feat: custom theme switcher button styles
1 parent 0bd9333 commit 1e12229

File tree

3 files changed

+10378
-15
lines changed

3 files changed

+10378
-15
lines changed

app/tag-data.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2+
"markdown": 1,
3+
"code": 1,
4+
"features": 1,
25
"next-js": 6,
3-
"tailwind": 3,
4-
"guide": 5,
5-
"feature": 2,
6-
"multi-author": 1,
7-
"hello": 1,
86
"math": 1,
97
"ols": 1,
108
"github": 1,
11-
"writings": 1,
12-
"book": 1,
13-
"reflection": 1,
9+
"guide": 5,
10+
"tailwind": 3,
11+
"hello": 1,
1412
"holiday": 1,
1513
"canada": 1,
1614
"images": 1,
17-
"markdown": 1,
18-
"code": 1,
19-
"features": 1
15+
"feature": 2,
16+
"writings": 1,
17+
"book": 1,
18+
"reflection": 1,
19+
"multi-author": 1
2020
}

components/ThemeSwitch.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ const ThemeSwitch = () => {
7878
leaveFrom="transform opacity-100 scale-100"
7979
leaveTo="transform opacity-0 scale-95"
8080
>
81-
<MenuItems className="ring-opacity-5 absolute right-0 z-50 mt-2 w-32 origin-top-right divide-y divide-gray-100 rounded-md bg-white ring-1 shadow-lg ring-black focus:outline-hidden dark:bg-gray-800">
81+
<MenuItems className="ring-opacity-5 absolute right-0 z-50 mt-2 w-32 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black focus:outline-hidden dark:bg-gray-800">
8282
<RadioGroup value={theme} onChange={setTheme}>
8383
<div className="p-1">
8484
<Radio value="light">
8585
<MenuItem>
8686
{({ focus }) => (
8787
<button
88-
className={`${focus ? 'bg-primary-600 text-white' : ''} group flex w-full items-center rounded-md px-2 py-2 text-sm`}
88+
className={`${focus ? 'bg-yellow-300 text-black' : ''} group flex w-full items-center rounded-md px-2 py-2 text-sm`}
8989
>
9090
<div className="mr-2">
9191
<Sun />
@@ -100,7 +100,7 @@ const ThemeSwitch = () => {
100100
{({ focus }) => (
101101
<button
102102
className={`${
103-
focus ? 'bg-primary-600 text-white' : ''
103+
focus ? 'bg-gray-800 text-white' : ''
104104
} group flex w-full items-center rounded-md px-2 py-2 text-sm`}
105105
>
106106
<div className="mr-2">
@@ -116,7 +116,9 @@ const ThemeSwitch = () => {
116116
{({ focus }) => (
117117
<button
118118
className={`${
119-
focus ? 'bg-primary-600 text-white' : ''
119+
focus
120+
? 'bg-gradient-to-r from-gray-300 via-white to-gray-300 text-black'
121+
: ''
120122
} group flex w-full items-center rounded-md px-2 py-2 text-sm`}
121123
>
122124
<div className="mr-2">

0 commit comments

Comments
 (0)