Skip to content

Commit cecb224

Browse files
committed
fix(TreeView): update hover styles for WHCM
1 parent cf87bdb commit cecb224

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/TreeView/TreeView.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,11 @@ const Item: React.FC<TreeViewItemProps> = ({
216216
borderRadius: 2,
217217
cursor: 'pointer',
218218
'&:hover': {
219-
backgroundColor: 'actionListItem.default.hoverBg'
219+
backgroundColor: 'actionListItem.default.hoverBg',
220+
'@media (forced-colors: active)': {
221+
outline: '2px solid transparent',
222+
outlineOffset: -2
223+
}
220224
},
221225
'@media (pointer: coarse)': {
222226
'--toggle-width': '1.5rem', // 24px
@@ -228,7 +232,10 @@ const Item: React.FC<TreeViewItemProps> = ({
228232
// Reference issue: https://github.com/styled-components/styled-components/issues/3265
229233
[`[role=tree][aria-activedescendant="${itemId}"]:focus-visible #${itemId} > &:is(div)`]: {
230234
boxShadow: (theme: Theme) => `inset 0 0 0 2px ${theme.colors.accent.emphasis}`,
231-
outline: '2px solid transparent'
235+
'@media (forced-colors: active)': {
236+
outline: '2px solid SelectedItem',
237+
outlineOffset: -2
238+
}
232239
},
233240
'[role=treeitem][aria-current=true] > &:is(div)': {
234241
bg: 'actionListItem.default.selectedBg',

0 commit comments

Comments
 (0)