Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
a11y: Add aria-label attributes and custom override control to core/social-link block #18651
Per #18620, I've modified the core/social-link block to contain an
Deque classifies missing descriptive text for links as a serious user impact and Google Lighthouse accessibility scores are negatively impacted without an
By default, if the user doesn't customize the label in the provided TextControl in the Inspector, the block will render
At this point, there is a fair amount of duplication between the PHP and JS file containing data about the brands. These are unlikely to change greatly, but I'm happy to address with a different approach if desired.
How has this been tested?
I've run the lint command, inserted each social icon and validated the display and markup for the Editor and Frontend render.
Types of changes
Unrelated to your changes, I'm still not thrilled with the implementation. I agree there is too much duplication between PHP and JS. The core issue at hand is wrangling the SVG, I have one unsuccessful attempt here: #18243
Additionally, I think we can simplify the list if we can solve the above, and then implement the ability to extend or modify, related issue #17277
@mkaz Thanks for the review! I'll push a commit to address the description & LinkedIn.
I'm also a fan of svgr, but from the chatter on #18243 sounds like that may require some creative solutions for the Gutenberg codebase.
I agree the implementation is fairly easy to understand, but perhaps leaves something to be desired from a developer experience and maintenance standpoint. Unfortunately, most other approaches I can think of would either transfer that burden to visitors or obfuscate to developers what's happening.
On my brain apart from svgr...
One more, Github --> GitHub, see #18714
With regards to SVG, thanks for the suggestions, I'll need to noodle on them a bit more, I like how you draw out the pros and cons to the various solutions. We discuss further in a separate PR, I have on my list to move them out of PHP into single SVG files this would improve one aspect, but need to consider how it might change after this PR, it may not make it easier overall