Skip to content

Content and Excerpt Blocks: Add indent controls#76952

Open
carolinan wants to merge 1 commit intotrunkfrom
add/content-textindent
Open

Content and Excerpt Blocks: Add indent controls#76952
carolinan wants to merge 1 commit intotrunkfrom
add/content-textindent

Conversation

@carolinan
Copy link
Copy Markdown
Contributor

@carolinan carolinan commented Apr 1, 2026

What?

Closes #76536

Add block support for text indent to the content and excerpt blocks.
In block.json, the text indent is added to a selector that targets the first paragraph inside the block.
(The reason why this is needed for the excerpt is that the "read more" link is in a paragraph.)

Testing Instructions

  1. Activate a block theme. Make sure the theme's blog uses the post content block.
  2. Go to Appearance > Editor > Styles > Blocks and select the content block.
  3. In the block's typography setting, locate the option "Line indent" and enter a value. Save.
  4. View the blog in the editor and the front, all post content blocks should show the first paragraph as indented.
  5. Open a single post or page in the block editor. Confirm that the first paragraph of the content is indented (This is because of the setting on the content block, not the paragraph block).

Repeat step 1-4 with the excerpt block.

Note that there are a few blocks that may look like they could be paragraphs, but are not indented, such as the login/out block. This block only uses the <a> tag.

Add block support for text indent to the content and excerpt blocks, including typography selectors.
@carolinan carolinan added the [Type] Enhancement A suggestion for improvement. label Apr 1, 2026
@github-actions github-actions bot added the [Package] Block library /packages/block-library label Apr 1, 2026
@carolinan carolinan added [Block] Post Content Affects the Post Content Block [Block] Post Excerpt Affects the Post Excerpt Block and removed [Package] Block library /packages/block-library labels Apr 1, 2026
@carolinan
Copy link
Copy Markdown
Contributor Author

@henriqueiamarino
This is what I mean with it maybe looking weird when the paragraph is not the first content of the post.

"Another post on my blog" is the post title.
Then there is a heading, a button block, and finally the paragraphs.

A screenshot of a blog post with the first paragraph of the post content indented.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Flaky tests detected in 9550735.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23831486628
📝 Reported issues:

@carolinan carolinan marked this pull request as ready for review April 1, 2026 05:47
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 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.

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

Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: henriqueiamarino <iamarinoh@git.wordpress.org>

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Post Content Affects the Post Content Block [Block] Post Excerpt Affects the Post Excerpt Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content and Excerpt Blocks: Add indent controls mirroring paragraph's Global Styles setting

1 participant