You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Global Styles: Add alignment support in global typography styles #48202
Before we land #48146, we'd like to first support alignment in global typography styles. Alignment support can include justification, as long as it also supports hyphenation.
To properly handle hyphenation, we'll need lang support on the block level at least, too: #15349
It is required in some news rooms and schools, and therefore necessary to support
It is in most cases harder to read than aligned text, providing an opportunity to show a legibility warning in context
Justified text in almost all cases is a global set it and forget it setting, unlike center/right aligned text, and therefore makes great sense in global styles. It makes less sense on a per-block basis, as we generally wouldn't want anyone who needs to use justified text to select all and choose "justified" across every post on a site.
In that light, here's a way way obsolete mockup of justified text in a global interface:
The icons, colors, all of the above are off, so do not take this as a design. Purely as an example of one way this interface might be put together.
Reacted by Antonio Sejas, strarsis and Jeremy Herve
Good point to clarify. I omitted center from the original designs because it seems borderline useless as a default layout for text, arguably even less legible than justified text. Though I suppose if it substantially eases implementation, and if the center option would carry a similar legibility warning as justified does, perhaps it might be fine, so as to unstick this?
I say we include them all, even without legibility notices. Sure, it may not be ideal, but I can see it working in some cases. And I'm hesitant to have some controls available in some places, while not in others.
As suggested in #60762, I am thinking of adding the text alignment UI at the block level first. If it ships successfully, I would like to come back to this issue.
I say we include them all, even without legibility notices. Sure, it may not be ideal, but I can see it working in some cases.
I would not omit the legibility notice, at least from the justified text one. It's a very common question why WordPress doesn't support justified text in the text alignment dropdown, and showing the legibility notice in context of the global control would provide the answer right there.
Activity
sejas commentedon Feb 17, 2023
I can start investigating this issue next week 👌
jasmussen commentedon Feb 23, 2023
A couple of notes on justified text:
In that light, here's a way way obsolete mockup of justified text in a global interface:
The icons, colors, all of the above are off, so do not take this as a design. Purely as an example of one way this interface might be put together.
strarsis commentedon Feb 28, 2023
Would this be also a good place for adding controls for
text-align-last?jasmussen commentedon Mar 1, 2023
Potentially. I haven't used that one very much.
Thelmachido commentedon Jun 2, 2023
Hi folks, thank you for working on this. Just making a note that this was requested in forums here: https://wordpress.org/support/topic/space-between-header-and-body-on-pages-drives-me-crazy/#post-16789630
jasmussen commentedon Mar 4, 2024
Per recent conversation, here's a refreshed version of how this could look:
sejas commentedon Apr 5, 2024
I unassigned me from this issue since we won't focus on this in the short time.
t-hamano commentedon Apr 20, 2024
textAlignblock support has been added in #59531. After that, we are first trying to add text alignment support at the block level.Related issues/PRs:
TextAlignmentControlcomponent #60841richtabor commentedon Apr 24, 2024
Why not put this within the Text and Headings views, rather than add another to this top-level typography? It could be hierarchal as well.
jasmussen commentedon Apr 25, 2024
Seems fine to do that. Figma if you want to tinker.
richtabor commentedon Apr 25, 2024
I added an alternate to the Figma. What do you think?
Based on #59531.
jasmussen commentedon Apr 25, 2024
Looks good! Whether it's the row of 4 icons or a vertical stack with labels, I've less of a strong opinion on, happy to defer.
What I'd deem important is to show the yellow notice below the justified text option when selected, I'm assuming that's still present?
richtabor commentedon Apr 25, 2024
Sure, I had missed that.
t-hamano commentedon Apr 26, 2024
If all four of
left,center,right, andjustifyare allowed, I think we can use theTextAlignmentControlcomponent added in #60841 as is.However, the original design only allows two types at the root level:
leftandjustfiy.Which options should be allowed?
jasmussen commentedon Apr 26, 2024
Good point to clarify. I omitted center from the original designs because it seems borderline useless as a default layout for text, arguably even less legible than justified text. Though I suppose if it substantially eases implementation, and if the center option would carry a similar legibility warning as justified does, perhaps it might be fine, so as to unstick this?
richtabor commentedon Apr 30, 2024
I say we include them all, even without legibility notices. Sure, it may not be ideal, but I can see it working in some cases. And I'm hesitant to have some controls available in some places, while not in others.
t-hamano commentedon May 1, 2024
Thanks for the feedback!
As suggested in #60762, I am thinking of adding the text alignment UI at the block level first. If it ships successfully, I would like to come back to this issue.
jasmussen commentedon May 1, 2024
I would not omit the legibility notice, at least from the justified text one. It's a very common question why WordPress doesn't support justified text in the text alignment dropdown, and showing the legibility notice in context of the global control would provide the answer right there.