Skip to content

Commit f7eb695

Browse files
authored
Merge pull request #13261 from tomasgrusz/fix-11591-1
style(Nav): shift hover transition to button children icon and add focus state
2 parents 1784cba + 30c9240 commit f7eb695

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/components/Nav/Desktop/index.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ const DesktopNavMenu = ({ toggleColorMode }: DesktopNavMenuProps) => {
3535
"Switch to Light Theme"
3636
)
3737

38+
const desktopHoverFocusStyles = {
39+
'& > svg': {
40+
transform: "rotate(10deg)",
41+
color: "primary.hover",
42+
transition: "transform 0.5s, color 0.2s"
43+
}
44+
}
45+
3846
/**
3947
* Adds a keydown event listener to toggle color mode (ctrl|cmd + \)
4048
* or open the language picker (\).
@@ -54,16 +62,13 @@ const DesktopNavMenu = ({ toggleColorMode }: DesktopNavMenuProps) => {
5462
return (
5563
<HStack hideBelow="md" gap="0">
5664
<IconButton
57-
transition="transform 0.5s, color 0.2s"
5865
icon={ThemeIcon}
5966
aria-label={themeIconAriaLabel}
6067
variant="ghost"
6168
isSecondary
6269
px={{ base: "2", xl: "3" }}
63-
_hover={{
64-
transform: "rotate(10deg)",
65-
color: "primary.hover",
66-
}}
70+
_hover={desktopHoverFocusStyles}
71+
_focus={desktopHoverFocusStyles}
6772
onClick={toggleColorMode}
6873
/>
6974

0 commit comments

Comments
 (0)