Skip to content

Commit ee8e155

Browse files
authored
Merge pull request #1019 from processing/pr-1017-2.0
Prevent hover state from sticking on mobile accessibility toggles [2.0]
2 parents ce48a5b + ca7a364 commit ee8e155

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/components/Dropdown/styles.module.scss

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
width: 100%;
2121
height: 100%;
2222
cursor: pointer;
23-
&:hover {
24-
border: 1px solid var(--accent-color);
25-
background-color: var(--accent-type-color);
26-
color: var(--accent-color);
23+
@media (hover: hover) and (pointer: fine) {
24+
&:hover {
25+
border: 1px solid var(--accent-color);
26+
background-color: var(--accent-type-color);
27+
color: var(--accent-color);
28+
}
2729
}
2830
}
2931

@@ -93,10 +95,13 @@
9395
}
9496
}
9597

96-
li[aria-selected="false"]:hover .icon {
97-
svg {
98-
background: var(--accent-type-color);
99-
border-radius: 2rem;
98+
// Only apply hover styles on devices with true hover capability (not touch devices)
99+
@media (hover: hover) and (pointer: fine) {
100+
li[aria-selected="false"]:hover .icon {
101+
svg {
102+
background: var(--accent-type-color);
103+
border-radius: 2rem;
104+
}
100105
}
101106
}
102107

0 commit comments

Comments
 (0)