-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Style Book: Allow button text labels for style book icon #48088
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. |
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.
Looks good from the accessibility side. Thanks!
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.
✅ 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 🙂 |
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.
Oops, yep. LGTM 👍
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 labels
editor 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 labels
setting, the expectation is that a text label would be used instead of an icon.How?
.show-icon-labels
classname that gets output to the site editor when theShow button text labels
setting is in use, add CSS rules that hide thesvg
element and display the aria-label text for the button instead.Open Style Book
andClose Style Book
toStyle Book
based on the feedback in Stylebook: icon doesn't respect text-only buttons option #48051 (comment).More styles actions
toStyles actions
for consistency and to better fit the text labels on a single row.Styles
text does not shrink smaller than its content (add amin-width: min-content
rule).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 Book
Note: the capitalisation here is a little off — that's because
Style Book
appears to be a proper noun, whereasStyles actions
is sentence case as it is not a proper noun. Happy for any feedback or suggestions there.Screenshots or screencast