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!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.