-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
A11y: Remove redundant styles #65409
base: trunk
Are you sure you want to change the base?
Conversation
This is a minimal way of setting the `hidden` attribute. From MDN: > The hidden attribute is used to indicate that the content of an element should not be presented to the user. This attribute can take any one of the following values: > > - an empty string > - the keyword hidden > - the keyword until-found > > An empty string, or the keyword hidden, set the element to the hidden state. Additionally, invalid values set the element to the hidden state. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
Size Change: -27 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@afercia might have some insight here. It might be tight to get this into 6.7, but worth a peek either way. |
Thanks for the ping. I'm not opposed to this change however it's worth noting that this is basically the ruleset for the In the past, there has been some effort to align all the occurrences and documentation of this ruleset across Core, Gutenberg, and Make WordPress. I'd encourage to create a Trac ticket for the Core part and ping the accessibility team to have a look and update the documentation Cc @joedolson Regading Gutenberg, it's worth noting there are usages of this ruleset in other packages. I do realize it will go beyond the scope of the a11y package but I think it's important to have a unique, consistent, implementation across all packages. It would be less than ideal to end up with this ruleset be slightly different across the various packages. A few occurrences I found by searching for |
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 think this is nice atomic improvement. We can address the rest that others mentioned in follow-ups 👍.
Please wait to merge until this has been acknowledged by the accessibility team and there is agreement to update the ruleset everywhere. |
Reviewing the support for I definitely agree with @afercia that we should streamline this; it would be preferable to have a single canonical reference to these styles rather than embedding them differently in a wide variety of packages. |
There are at least seven additional places where we should match updates: common.css, install.css, admin-bar.css, media-views.css, wp-embed-template.css, and login.css in core, and in the documentation on make/accessibility. If we're agreed this change should move forward in Gutenberg, I can raise a ticket and commit the equivalent changes in core & make. |
It sounds like practical next steps might be: Gutenberg (@colorful-tones to address)
WordPress (@joedolson to address)
The new CSS (alpha-sorted):
|
@joedolson @afercia @kevin940726 @sirreal maybe give a 👍 if you're ok with this plan please? |
Based on @kevin940726 approved changes. We should be good to merge this. I'll let @sirreal do the honors. @joedolson do you happen to have a corresponding Trac ticket on your side? Do you think this is suitable to target for 6.7 inclusion? If so, we should probably aim to have the follow-up tasks merged by the end of the week and ready for RC1. cc: @getdave in case this is too unrealistic and any further insight for the release cycle. |
It's a fairly trivial change to make and also fairly easily reverted, if that were necessary, so it's feasible. There's no current core ticket, but that wouldn't take long. I wouldn't consider it a high priority, however, given the overall low impact. I think it makes more sense to just bump it to 6.8. |
Given this PR:
...let's avoid potential for introducing any regressions into the release cycle for 6.7. I vote to punt to 6.8. |
No objections. Note: I just merged #66145 which is slated for Gutenberg 19.5 / WordPress 6.8. |
I've accepted ownership of https://core.trac.wordpress.org/ticket/62238 and milestoned for 6.8. |
What?
wp-a11y
script size by removing redundant styles, spacing, and attribute values.string
type.This could be further refactored to move the styles to a single container element, although that is a bit trickier with this approach because the elements that are added are all added conditionally to account for elements that may already exist in the HTML.
Why?
#65380 (comment) indicated that there were opportunities for improvement here.
Testing Instructions
When the
wp-a11y
script is loaded on the page, the relevant DOM elements are styled in the same way with only redundant styles being removed.Screenshots or screencast
HTML
The "polite" live region is not included here because it is nearly identical to the "assertive" region.
Before
After
Style attribute