Default block.json margin values
-
{ "$schema": "https://schemas.wp.org/trunk/block.json", "name": "acf/hero-two", "title": "Hero Two", "description": "A custom hero_two block that uses ACF fields.", "category": "formatting", "icon": "admin-comments", "keywords": ["hero_two", "hero", "toggle", "collapse"], "acf": { "mode": "preview", "renderTemplate": "hero-two.php" }, "attributes": { "style": { "type": "object", "default": { "spacing": { "margin": { "top": "32px" } } } } }, "supports": { "align": true, "spacing": { "margin": true, "padding": true }, "anchor": true, "alignContent": false, "color": { "text": false, "background": false, "link": false }, "alignText": false, "fullHeight": false } }
Hello, I setup my block.json like this and when I load the block in the block editor and look under the styles tab it gets set to the “32px” however when I go the the front end where I am applying these styles with
<?= get_block_wrapper_attributes(); ?>
nothing is output. if I remove these settings in block.json and set a spacing value normally the function sets the styles without any issue.
Why is it showing me that 32px is set on the slider, but the style is never passed to the front end? Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Default block.json margin values’ is closed to new replies.