Adding margin and padding to a custom block
-
I’m having trouble understanding the the interaction between global styles and how these apply to custom blocks I’ve created.
I’m trying to add margin and padding support to a custom block. I have added
add_theme_support( 'custom-spacing' );
to my theme’s functions.phpand
supports: { spacing: { margin: true, padding: true, } }
to my custom block’s index.js file
but no options are appearing for my block.
I’m using a theme.json file and have tried adding the support into that file too
"settings": { ... "blocks": { "category/blockname": { "spacing": { "padding": true, "margin": true } } } }
Is this even possible?
Any help appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding margin and padding to a custom block’ is closed to new replies.