Admin UI: apply 'text-wrap: pretty' to Page#74907
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: +179 B (+0.01%) Total Size: 3 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 54748fc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/21297415653
|
|
In principle, I'm a fan. However I think I tried a PR like this in the past, and was specifically suggested to move it to the Text component. I don't recall the precise details. Another aspect is that this should possibly be a core patch, rather than added to the Gutenberg package. I'll defer to any dev on this, but approve of applying pretty wrapping more broadly. |
|
@jasmussen, since the Page component (within Admin-UI package) is very new (introduced 2025-10-17), this would be quite a bit more limited change compared to what I assume you might've tried in the past; applying the rule to all of Gutenberg editors or all of WP Admin. I agree wider adoption should go via WP core, but this seems like a good, limited way to start testing. |
|
For clarity, here's the current usage of Appearance → Fonts
Appearance → Editor → Patterns
Appearance → Editor → Pages
Appearance → Editor → Styles
Since basically all these UIs already use the However, any plugin using the exported |
|
I'm happy to 👍 👍 this one, so the reason I'm not is that I think this mostly needs a technical gut-check. Perhaps CC: @WordPress/gutenberg-design to be sure. |
|
I understand that this property might impact performance when applied to multiple texts without thoroughly identifying which one needs it. But if my point is not true or real concern, then I have no opinions about the change. |
|
I remember @jasmussen referencing some performance testing in the past in another project but I don't have details:
In a bit older guide (circa 2023?) Pretty (Chrome guide) is simpler, with basically just avoiding typographic orphans. So to be more concervative we could limit the fallback rule to apply only to headings and paragraphs. That said, the current |
54748fc to
6d8ae1c
Compare
|
Thanks for the PR!
I recommend not using the For reference, see https://core.trac.wordpress.org/ticket/60892. The About page for the Japanese locale shows an example of how
I believe this was added in #62233, but I think this fallback approach is worth revisiting. This means that the fallback for
P.S. The |
|
Personally, I suggest the following approach:
|
Do you reckon the fallback still makes sense for heading elements ( |
6d8ae1c to
05beada
Compare
Yep, you're right! https://caniuse.com/?search=css-text-wrap-pretty
I copied the comment from the |
Rather, the problem is applying fallbacks to headings. That's exactly the issue reported in core. See this screenshot: https://core.trac.wordpress.org/attachment/ticket/60892/Actual%20and%20expected%20display.png If we want to apply fallbacks to headings, I suggest limiting it to the English locale. Personally, I would avoid |
|
I'd echo: balance as a fallback has not worked as well in practice. It's quite different from pretty. |
|
Sounds good! Then this PR is ready for a review. |
|
Removing |
fa0b3a7 to
9ca4103
Compare
Co-authored-by: simison <simison@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: fcoveram <fcoveram@git.wordpress.org>
Co-authored-by: simison <simison@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: fcoveram <fcoveram@git.wordpress.org>







What?
Apply
text-wrap: prettyfor more balanced text in thePagecomponent.Currently, in Gutenberg to get balanced text, you need to usethe
Textcomponent:gutenberg/packages/components/src/text/styles.ts
Lines 15 to 16 in 5cbdbc2
Using
Texteverywhere is fairly tedious, and I believe we could achieve better UIs going forward if we applied the rule more widely. Since it can be too much to apply all-Gutenberg or all WP Admin wide, we could start from the Page component, which is mostly used to build new UIs.This PR does not include
balancefallback, and it should be removed from the Text component as well. See discussion below.Why?
via MDN
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast