-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Global Styles: Add text justify #73201
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
|
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. |
|
Size Change: +122 B (+0.01%) Total Size: 2.41 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 7cc597c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19327010834
|
jasmussen
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.
Outstanding. Works:
That GIF also shows one hiccup, though: after saving new block styles, the site editor requires a reload before the styles apply. But that is unrelated to this PR, and the case for other style changes. Do you know if there's an issue for it?
One thing I'd love to see, however, is a notice below the alignment picker. It could just be a standard <Notice> component, just like we do for missing contrast in the color panel, that reads something like:
Note: justified text can reduce readability, especially for users with visual or cognitive impairments. For better accessibility and legibility, consider using left-aligned text instead.
I don't know that's a blocker, but it would be a good thing to add. Is that easily doable?
|
To me, this is no different than a failling contrast, to answer the "why". It's also shown in a set-it-and-forget-it-context, so you won't see it that often. If it helps, you can change it from warning to info, to make it more neutral looking. We can also reduce the text. Perhaps:
|
It's different in the sense that failing contrast is not something you turn on and off, you can change colors and that's it. Here it's for everyone using it, one might argue that we should just not have it. |
|
My understanding is that the justify option is needed in the first place because it may be used in some industries (publishers, schools, etc.). Is that correct? |
|
A help text that appears for a specific value is very similar to what we have with the warning, so let's start with that and see. |
|
I was not arguing for removing the feature btw, my preference would be to not have a warning in the first place because there are valid use-cases. |
|
I don't have a strong opinion about the warning itself, but I prefer help text. |
There are valid use cases. But we just want to nudge you towards applying this feature only if you know what you are doing and really need it. |



What?
Closes #48202
Now that we migrated the paragraph block to the textAlign block support, we can enable justify at the global styles level.
Note The justify icon looks a bit weird compared to the other alignments icons but we can fix it separately if needed.
Testing Instructions