Style Book: Allow button text labels for style book icon#48088
Conversation
|
Size Change: +711 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 39d84d9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4188586411
|
|
Thanks for the PR @andrewserong! The code looks good to me on first glance. It does seems that the Playwright e2e test that has been changed is failing now, so that might require a bit more testing. |
joedolson
left a comment
There was a problem hiding this comment.
Looks good from the accessibility side. Thanks!
apeatling
left a comment
There was a problem hiding this comment.
✅ Tested and the text label now displays correctly.
LGTM with Kai's suggested change. 👍
Co-authored-by: Kai Hao <kevin830726@gmail.com>
|
Thanks @kevin940726, that fixed up the failing e2e test! Do you mind giving this another look when you get a chance? I think we need your ✅ before it'll unlock merging 🙂 |
|
Thanks @kevin940726! 🙂 |
* Global styles sidebar: Allow text labels on buttons * Simplify labels * Update e2e tests * Fix failing test Co-authored-by: Kai Hao <kevin830726@gmail.com> --------- Co-authored-by: Kai Hao <kevin830726@gmail.com>
|
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: e5ea64e |
What?
Fixes #48051
As raised in the linked issue, when using the
Show button text labelseditor setting, the icon for the Style Book button is still displayed as an icon, rather than its text label. This PR allows that setting to switch the Style Book icon over to using its text label, and also tweaks the text labels in that row.Why?
The style book icon isn't self-explanatory, and for users who use the
Show button text labelssetting, the expectation is that a text label would be used instead of an icon.How?
.show-icon-labelsclassname that gets output to the site editor when theShow button text labelssetting is in use, add CSS rules that hide thesvgelement and display the aria-label text for the button instead.Open Style BookandClose Style BooktoStyle Bookbased on the feedback in Stylebook: icon doesn't respect text-only buttons option #48051 (comment).More styles actionstoStyles actionsfor consistency and to better fit the text labels on a single row.Stylestext does not shrink smaller than its content (add amin-width: min-contentrule).Note: the close button has not been included in the button label text in this PR as there is currently limited space in this row to fit each of the elements. This could be explored separately in a follow-up if it's desired to include that one, too.
Happy for any feedback on the labelling, though!
Testing Instructions
Style BookNote: the capitalisation here is a little off — that's because
Style Bookappears to be a proper noun, whereasStyles actionsis sentence case as it is not a proper noun. Happy for any feedback or suggestions there.Screenshots or screencast