-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Improve Notice component accessibility. #54498
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
Conversation
Mamaduka
left a comment
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.
To avoid creating a fresh installation, we can just clear the preferences from the user meta:
wp user meta delete <user> wp_persisted_preferences
|
I think the Github actions are going a bit nuts?
|
|
Sometimes, it fails when there's more than one P.S. I need to call it a day now, but I will properly test/review this on Monday if nobody beats me to it. |
| return __( 'Warning notice' ); | ||
| case 'info': | ||
| return __( 'Information notice' ); | ||
|
|
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.
Nit: I think we can remove this empty gap here.
alexstine
left a comment
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.
|
Added to the components board so that sub-team is aware. 👍 |
This could be a problem, as Accessibility is typically something that spans across several areas and it is likely we'd need to att the Accessibility lable to issues and PRs that already have another [Type] label. |
|
Flaky tests detected in 5812f03. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6221279720
|
|
Size Change: -1.63 kB (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
aristath
left a comment
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.
I just added a small nitpick, but it;'s not a blocker so I'll go ahead and approve this 👍
| case 'success': | ||
| default: |
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.
Should we remove the case 'success': line here? The default already acts as a fallback, so that line doesn't serve a purpose 🤔
| case 'success': | |
| default: | |
| default: |
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.
I guss that for consistency the redundant case should be removed from getDefaultPoliteness as well.
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.
Changes look good to me.
Can we just add a CHANGELOG entry before merging? Thank you!
|
|
||
| .components-notice__dismiss:not(:disabled):not([aria-disabled="true"]) { | ||
| color: $gray-400; | ||
| } | ||
|
|
||
| .components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):focus, | ||
| .components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):active, | ||
| .components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):hover { | ||
| color: $gray-100; | ||
| color: $white; | ||
| } |
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.
We should really avoid these styles overrides (and using internal components classnames outside of the components package), although I understand this is something that should be addressed separately from this PR.
Create a PR to fix this issue - #54724 |

Fixes #54497
First pass at improving / fixing the Notice component accessibility. Please do not merge yet, needs design feedback.
What?
Imrpoves / fixes the Notice component accessibility.
Why?
There is no parity between the information provided visually and the information provided semantically / with text. As such, some users experience is less than ideal.
How?
Information noticetoCloseso that accessible name matches more closely the concept provided by the X icon.showTooltip={ false }so that the button renders its tooltip. Again worth reminding all icon buttons must visually expose their accessible name,Testing Instructions
Looking for template parts? Find them in "Patterns". notice is rendered.Information notice.Closeis rendered.Testing Instructions for Keyboard
Screenshots or screencast