Support

Account

Home Forums Gutenberg CSS Class does not apply to custom block – ACF v5.8 Reply To: CSS Class does not apply to custom block – ACF v5.8

  • As i see it, it is easy to add the custom css class to your block, you can decide where to place the css class in the same way as you would set your block alignment.

    You can use $block to get gutenberg settings.

    Place $block[‘className’] in the containing div of your block element, and then it should work.

    There are other values stored in $block as well:

    ‘name’
    ‘title’
    ‘description’
    ‘category’
    ‘icon’
    ‘mode’
    ‘align’
    ‘keywords’
    ‘supports’
    ‘post_types’
    ‘render_template’
    ‘render_callback’
    ‘multiple’
    ‘className’
    ‘data’
    ‘id’

    Hope this helps!