In theme.json settings undre version:3,
"spacing": {
"blockGap": true
},
is boolean, any efforts to make it set like:
"spacing": {
"blockGap": "2rem"
},
generates warning in VS Code —
Incorrect type. Expected "boolean". Enables
--wp--style--block-gap
to be generated from styles.spacing.blockGap.A value of
null
instead offalse
further disables layout styles from being generated.
What approach should I follow to ensure that all gutenberg blocks in backend/frontend should have certain gaps.
In theme.json settings undre version:3,
"spacing": {
"blockGap": true
},
is boolean, any efforts to make it set like:
"spacing": {
"blockGap": "2rem"
},
generates warning in VS Code —
Incorrect type. Expected "boolean". Enables
--wp--style--block-gap
to be generated from styles.spacing.blockGap.A value of
null
instead offalse
further disables layout styles from being generated.
What approach should I follow to ensure that all gutenberg blocks in backend/frontend should have certain gaps.
You can define a default for BlockGap in the "styles" section of your theme.json:
styles.spacing.blockGap
{
...
"settings": {
"spacing": {
"blockGap": true //turns overall blockGap support in the editor on and off
},
},
"styles": {
"spacing": {
"blockGap": "2rem" // sets the default style for the blockGap property
},
},
...
}