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

Add blockGap support to paragraph block #44232

Open
bradhogan opened this issue Sep 16, 2022 · 6 comments
Open

Add blockGap support to paragraph block #44232

bradhogan opened this issue Sep 16, 2022 · 6 comments
Labels
[Block] Paragraph Affects the Paragraph Block [Type] Enhancement A suggestion for improvement.

Comments

@bradhogan
Copy link

It would be useful to be able to overwrite the main gap value for a site within the paragraph block. For example, if I don't want my gap between paragraphs to be the same as the gap between columns, then I should be able to control that. If defined in the theme.json, it would look like:

"core/paragraph": {
  "spacing": {
	  "blockGap": "1.5rem"
  }
}

Here's a related issue and the above request would resolve this.

@artemiomorales artemiomorales added [Type] Enhancement A suggestion for improvement. [Block] Paragraph Affects the Paragraph Block labels Sep 16, 2022
@t-hamano
Copy link
Contributor

Hi @bradley2083,
Could your problem be solved by wrapping multiple blocks in a group block?
I think the block gap is only for adjusting the spacing of multiple elements within a single block. And I believe there are no multiple elements in a paragraph block, but simply a line break.

430cb04e1878c1dc9976048049e17ed0.mp4

Or, if you want to adjust the default space between paragraphs, margin should work instead of blockGap.

margin

@bradhogan
Copy link
Author

bradhogan commented Sep 17, 2022 via email

@t-hamano
Copy link
Contributor

The blockGap supported by a block is only to adjust the margins between elements within that block.
It should not control the margins with other blocks.
If you want to define margins between blocks, including paragraphs, you can define styles.spacing.blockGap.

{
	"styles": {
		"spacing": {
			"blockGap": "30px"
		}
	}
}

@bradhogan
Copy link
Author

I understand we can set the global option for blockGap in styles, but that sets the blockGap for ALL blocks. I'm suggesting a very practical addition of adding blockGap support for the paragraph block. There are many instances in a design where a theme dev might want to have the default blockGap set to something much larger than what they would want the paragraph spacing to be.

@t-hamano
Copy link
Contributor

t-hamano commented Sep 17, 2022

I understand.
However, I think it should be called "margin", not "blockGap".
Furthermore, I believe your intent was to specify a specific margin based on the combination of the current block and the next block.

Then, for example, the following approach might make sense:

"core/paragraph": {
	"spacing": {
		"nextBlockMargin":  [
			// Margin between paragraphs
			{
				"nextBlocks": [ 'core/paragraph'],
				"margin": "1em"
			},
			// Margin between paragraph and heading
			{
				"nextBlocks": [ 'core/heading'],
				"margin": "2em"
			}
		]
	}
}

@jordesign
Copy link
Contributor

jordesign commented Aug 18, 2023

This is in many ways similar to #51255

I'd agree with the comments above that this isn't a Block Gap issue - but more to do with having the margin overide any block gap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants