Support

Account

Home Forums Gutenberg Rendering core spacing in custom block

Helping

Rendering core spacing in custom block

  • I have added custom spacing to my theme.json. My values are showing and working in core and acf blocks that I have turned on spacing support for.

    I can also see a value for $block['style']['spacing']['padding']['top'] but it is a useless string: "var:preset|spacing|MM"

    When I use get_block_wrapper_attributes() I get the proper classes class="aligncenter wp-block-acf-block-template" but I never get style="" values like my core blocks:

    style="padding-top:var(--wp--preset--spacing--m);padding-right:var(--wp--preset--spacing--m);padding-bottom:var(--wp--preset--spacing--m);padding-left:var(--wp--preset--spacing--m)"

    How can I get the style values properly rendered in my block?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.