-
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
Block card: Fix typographic widow. #61438
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: -34 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
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.
If we need to apply text-wrap: pretty
to this part, doesn't that mean we need to follow Gutenberg's typography system, which means replacing it with a Text
component?
<Text className="block-editor-block-card__description">
{ description }
</Text>
For example, the site editor template description already uses this component.
However, this component has a zero margin applied, so it will override the 4px ($grid-unit-05
) top margin.
To solve this, how about using padding instead of margin, or changing the card content itself to a stacked layout and applying gap?
While we're at it we should fix this 🙈 ![]() Seems to be caused by Edit: Nevermind, this seems to be fixed by #61137. |
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.
LGTM 👍
Looks like I need to fix some tests. I'll do that when I get a moment! Thanks for the advice and reviews. |
Sorry, we should have left the class name. It should now pass the E2E test. |
Looks like there's a new failing test. I can look again at a different time, but have to move on to other things. If any of you want to, feel free to push changes, otherwise I'll get back to it when I can! |
@jasmussen I've fixed the code so that it passes the e2e tests, and I updated this branch with the latest trunk just to be sure. Once GitHub Actions passes, I should be able to merge this PR. |
Want to merge or should I press the button? Thanks again. |
* Block card: Fix typographic widow. * Use Text and VStack. * Restore classname. * Try to fix e2e test --------- Co-authored-by: Tetsuaki Hamano <[email protected]>
* Block card: Fix typographic widow. * Use Text and VStack. * Restore classname. * Try to fix e2e test --------- Co-authored-by: Tetsuaki Hamano <[email protected]>
What?
Fix a typographic widow — a terrible typographical term for a word that stands alone on a line — in the block card.
Why?
This balances the text to be harmonious, while working across translations. It is already applied by default to the
Text
component.How?
By applying
text-wrap: pretty;
.Testing Instructions
Screenshots or screencast
Before:
After: