File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,18 @@ export function ThemeToggle() {
1919 size = "icon"
2020 onClick = { toggleTheme }
2121 aria-label = "Toggle theme"
22+ className = "relative p-2 rounded-full transition-colors duration-300 hover:bg-gray-200 dark:hover:bg-gray-700"
2223 >
23- { /* Icon transitions */ }
24- < Sun className = "h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
25- < Moon className = "absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
24+
25+ < Sun className = { `h-5 w-5 text-black-500 transition-all duration-500 ease-in-out transform ${
26+ theme === "dark" ? "rotate-180 opacity-0 scale-0" : "rotate-0 opacity-100 scale-100"
27+ } `}
28+ />
29+
30+ < Moon className = { `absolute h-5 w-5 text-white-700 transition-all duration-500 ease-in-out transform ${
31+ theme === "light" ? "rotate-0 opacity-0 scale-0" : "rotate-120 opacity-100 scale-100"
32+ } `}
33+ />
2634 </ Button >
2735 )
2836}
29-
You can’t perform that action at this time.
0 commit comments