Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TreeView): add hcm styles for aria-current in TreeView #2492

Merged
merged 4 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-rabbits-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Add support for aria-current styles in high contrast mode for TreeView
7 changes: 5 additions & 2 deletions src/TreeView/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const Item = React.forwardRef<HTMLElement, TreeViewItemProps>(
'&:focus-visible > div': {
boxShadow: (theme: Theme) => `inset 0 0 0 2px ${theme.colors.accent.emphasis}`,
'@media (forced-colors: active)': {
outline: '2px solid SelectedItem',
outline: '2px solid HighlightText',
outlineOffset: -2
}
}
Expand Down Expand Up @@ -272,7 +272,10 @@ const Item = React.forwardRef<HTMLElement, TreeViewItemProps>(
height: '24px',
content: '""',
bg: 'accent.fg',
borderRadius: 2
borderRadius: 2,
'@media (forced-colors: active)': {
backgroundColor: 'HighlightText'
}
}
}
},
Expand Down