Skip to content

Conversation

@Shekhar0109
Copy link
Contributor

@Shekhar0109 Shekhar0109 commented Jan 18, 2026

What?

Closes #74717

Adds box-sizing: border-box for the Verse block.

Why?

The Verse block can overflow and not respect container max-width when padding is applied. box-sizing: border-box ensures sizing stays within the container.

How?

Adds box-sizing: border-box to pre.wp-block-verse.

Testing Instructions

  1. Create a post/page.
  2. Add a Group block and set a narrow max-width (or constrained layout).
  3. Insert a Verse block inside it.
  4. Apply left/right padding to the Verse block.
  5. Add long text and confirm it stays within max-width without overflow.

@github-actions
Copy link

github-actions bot commented Jan 18, 2026

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block library, [Block] Verse, First-time Contributor, [Block] Search.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions
Copy link

github-actions bot commented Jan 18, 2026

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 props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @EldarAgalarov.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: EldarAgalarov.

Co-authored-by: Shekhar0109 <[email protected]>
Co-authored-by: SirLouen <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added [Package] Block library /packages/block-library First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository labels Jan 18, 2026
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Shekhar0109! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@t-hamano t-hamano added [Block] Verse Affects the Verse block [Block] Search Affects the Search Block - used to display a search field labels Jan 19, 2026
@SirLouen
Copy link
Member

@t-hamano I'm not sure if this approach is mutually exclusive with #74723

What do you say?

@t-hamano
Copy link
Contributor

#74722 and #74723 are not exclusive; they solve different problems.

This PR resolves overflow when the left or right padding is applied to a block.

Here is an example of the Verse block:

trunk This PR
image image

However, since the Search block doesn't support padding in the first place, box-sizing doesn't appear to make any visual changes.

@Shekhar0109, why did you add box-sizing to the Search block as well as the Verse block?

@SirLouen
Copy link
Member

This PR resolves overflow when the left or right padding is applied to a block.

👌 I saw it clearer after reading through #43465 I did not understand at first the intention of #74717 and then I noticed that #74723 was also a good addition.

@Shekhar0109
Copy link
Contributor Author

@t-hamano Thanks!

I added box-sizing: border-box for Search too because the original issue (#74717) mentioned both Verse + Search having max-width/overflow issues, and the fix is basically the same at the wrapper level.

That said, if Search doesn’t actually show any change right now (since it doesn’t support padding), I’m totally fine dropping the Search part and keeping the PR only for Verse. Just let me know what you prefer and I’ll update the PR.

@t-hamano
Copy link
Contributor

@Shekhar0109 Can we focus on the Verse block only in this PR? See #74717 (comment) for the reason.

It would also be great if you could update the PR title and description.

@Shekhar0109
Copy link
Contributor Author

@t-hamano Sure! I’ll update this PR to focus on the Verse block only and adjust the PR title/description accordingly. Thanks for the guidance.

@Shekhar0109 Shekhar0109 changed the title Fix: add border-box sizing for verse and search blocks Fix: add border-box sizing for verse block Jan 21, 2026
@Shekhar0109
Copy link
Contributor Author

@t-hamano Quick update: I’ve reverted the Search change, so this PR is Verse-only now, and updated the title/description accordingly.

Copy link
Member

@SirLouen SirLouen left a comment

Choose a reason for hiding this comment

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

I'm trying to find out the test instructions

I cannot see under which exact conditions this makes a thing. Definitely with the OP test conditions I can't see any difference

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM!

I'm trying to find out the test instructions
I cannot see under which exact conditions this makes a thing. Definitely with the OP test conditions I can't see any difference

It's helpful to apply both padding and a background color to the Verse block.

Before

Image

After

Image

@t-hamano t-hamano merged commit 6f6ea41 into WordPress:trunk Jan 22, 2026
40 checks passed
@github-actions github-actions bot added this to the Gutenberg 22.5 milestone Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Search Affects the Search Block - used to display a search field [Block] Verse Affects the Verse block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core/verse, core/search: Missing box-sizing: border-box property.

3 participants