Skip to content
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

Post title block default CSS: add a break-word rule by default #35703

Merged
merged 2 commits into from
Nov 13, 2021

Conversation

audrasjb
Copy link
Contributor

Description

Post title should have a minimal break-word rule by default to avoid content overflow when grid layout is used for query loops.

How has this been tested?

Using Gutenberg + Twenty-Twenty Two grid layout query loop.
For the content, I used Theme Review Team Unit test data.

Screenshots

Before the change:

After the change:

Types of changes

Adds a new CSS declaration in the post-title block SCSS stylesheet.
That's not a breaking change.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@carolinan
Copy link
Contributor

The combination of display: inline-block and word-break: break-word does not prevent the overflow when the query loop uses the list view, only the grid view.

Does anyone know why display: inline-block is used when the title is a link?

@aristath
Copy link
Member

The combination of display: inline-block and word-break: break-word does not prevent the overflow when the query loop uses the list view, only the grid view.

Does anyone know why display: inline-block is used when the title is a link?

It was done for #30666

Perhaps break-word should be moved to the parent element?
So the final CSS would be

.wp-block-post-title {
 	word-break: break-word;
}
.wp-block-post-title a {
 	display: inline-block;
}

@carolinan
Copy link
Contributor

@audrasjb Do you know if you will have time to update this?

@audrasjb
Copy link
Contributor Author

audrasjb commented Nov 4, 2021

@carolinan yep sure, I'm on it!

@audrasjb
Copy link
Contributor Author

audrasjb commented Nov 4, 2021

@carolinan @aristath just refreshed the PR to move break-word declaration to the parent element.

Copy link
Contributor

@carolinan carolinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I have tested the PR with Emptytheme and Twenty Twenty-Two and it is working well.

@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Post Title Affects the Post Title Block labels Nov 13, 2021
@carolinan carolinan merged commit 1f0f834 into WordPress:trunk Nov 13, 2021
@github-actions github-actions bot added this to the Gutenberg 12.0 milestone Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Title Affects the Post Title Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants