Custom Block Margin
Last modified: November 13, 2024
Extension name
t2/custom-block-margin
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
}
}
Settings
Changing the margins can be done trough theme.json
in your theme with the following structure:
V2
{
"settings": {
"custom": {
"t2/custom-block-margin": {
"spacing": {
"default": "3rem",
"last": "5rem",
"xSmall": "0.5rem",
"small": "1rem",
"medium": "3rem",
"large": "5rem",
"xLarge": "10rem"
}
}
}
}
...
}
V1
Add basic style margin between blocks on the site. The config allows you to set
3 different margins.
normal
: Default block margin.small
: Margin used on blocks that needs less space between them. Ex. two paragraphs after each other.last
: Last block in block context container (except full width blocks).
{
"settings": {
"custom": {
"t2/custom-block-margin": {
"spacing": {
"normal": "3rem",
"small": "1rem",
"last": "5rem"
}
}
}
}
...
}