Support

Account

Home Forums Gutenberg ACF 5.8 blocks – styles

Solving

ACF 5.8 blocks – styles

  • Hi all,
    I’m testing ACF 5.8.2 beta and I can’t find one basic feature of guttenberg blocks – adding styles for front-end and back-end.
    It would be great if acf_register_block(…) accepts as arguments paths to block styles ( or at least to backend styles )

    Otherwise, the integration looks great.

  • As mentioned in this Blog-Post, you should use admin_enqueue_scripts() and wp_enqueue_scipts() functions.

  • You can also add an editor stylesheet using wordpress’s existing functionality

    https://codex.wordpress.org/Editor_Style

    so what I’d did was setup my sass build script to exported my block specific css to an editor-styles.css as well as the main stylesheet.

    Its a bit fiddler to make sure that your blocks’ css is self contained but it works pretty well and beats maintaining two different stylesheets

    • asolu

    • January 23, 2019 at 3:33 am

    by using wp_enqueue_scipts() , admin_enqueue_scripts() not work

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.