theme-experiments icon indicating copy to clipboard operation
theme-experiments copied to clipboard

TT1 blocks: Enable margin support in theme.json for 10.7

Open carolinan opened this issue 4 years ago • 4 comments

This is more of a heads up that we can start working on adding support for margins via theme.json for Gutenberg 10.7.

carolinan avatar May 12 '21 07:05 carolinan

Can you add a hint to how this can be done? eg an extract from theme.json

bobbingwide avatar Jun 03 '21 11:06 bobbingwide

There is some information regarding theme.json support here. Specifically customMargin must be enabled via theme.json (it defaults to false). Once that is done in the same way that 'padding' can be added to block style configuration so too can margin. e.g.:

	"core/group": {
		"spacing": {
			"margin": {
				"top": "10px",
...

Not all blocks support user-controlled margins (not many at this point). I haven't explored this much but most (all?) blocks SHOULD have the ability to have margins configured via theme.json - user support configured via block.json or not. But I have not confirmed this.

pbking avatar Jun 03 '21 13:06 pbking

Is there anything we need to do about this?

MaggieCabrera avatar Jul 06 '22 10:07 MaggieCabrera

Theme.json already includes "appearanceTools": true, but we need version 2 for it to work. I set it to 2 in #307.

carolinan avatar Jul 06 '22 11:07 carolinan