Custom Block Margin

Last modified: November 13, 2024

link Extension name

t2/custom-block-margin

link Setting version

You need to set a version in t2.json. This is used to determine which version
of the extension to use.

If you don't set a version, the extension will trigger a warning and fallback to
version 1. Latest version is 2.

{
	"t2/custom-block-margin": {
		"version": 2
	}
}

link Settings

Changing the margins can be done trough theme.json in your theme with the following structure:

link V2

{
	"settings": {
		"custom": {
			"t2/custom-block-margin": {
				"spacing": {
					"default": "3rem",
					"last": "5rem",
					"xSmall": "0.5rem",
					"small": "1rem",
					"medium": "3rem",
					"large": "5rem",
					"xLarge": "10rem"
				}
			}
		}
	}
	...
}

link V1

Add basic style margin between blocks on the site. The config allows you to set
3 different margins.

{
	"settings": {
		"custom": {
			"t2/custom-block-margin": {
				"spacing": {
					"normal": "3rem",
					"small": "1rem",
					"last": "5rem"
				}
			}
		}
	}
	...
}