-
Notifications
You must be signed in to change notification settings - Fork 646
ActionList: a11y fixes #1958
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
ActionList: a11y fixes #1958
Changes from all commits
de32f66
9e4ef53
d35bcf3
cfa94c4
09e0bf9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@primer/react": patch | ||
| --- | ||
|
|
||
| ActionList: Add focus styles for Windows high contrast mode | ||
| ActionList: Fix incorrect role for ActionList.Group outside ActionMenu | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,6 +159,14 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>( | |
| } | ||
| }, | ||
|
|
||
| '@media (forced-colors: active)': { | ||
| ':focus': { | ||
| // we set color to be transparent and let the high contrast rules | ||
| // decide what color with contrast should that be corrected to | ||
| outline: 'solid 1px transparent !important' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there documentation about this browser behavior anywhere?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also what happens with safari with this media tag?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yep! Here's the color adjustment spec and windows blog post with transparent tip. I got this trick from primer/css action-list-item.scss
Safari doesn't support it, so it skips it. (Not sure if there's a way to make this work with windows high contrast + safari) |
||
| } | ||
| }, | ||
|
|
||
| /** Divider styles */ | ||
| '[data-component="ActionList.Item--DividerContainer"]': { | ||
| position: 'relative' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI you can add multiple changesets in one PR