Support

Account

Home › Forums › ACF PRO › ACF6 + register_block_type + assets › Reply To: ACF6 + register_block_type + assets

  • today i had some capacities to give it a try. because there is a viewScript node, i discovered there is also a viewStyle node. And both are working similar. They both load the assets only if the block i actually used. But viewStyle loads the file as inline-css in the <body>. So this seems finally solved for me.
    my old code:

    "style": ["file:./assets/tabgroup.css","tabgroup"],
    "script": ["file:./assets/tabgroup.js","tabgroup"],

    recent working code:

    "viewStyle": ["file:./assets/tabgroup.css","tabgroup"],
    "viewScript": ["file:./assets/tabgroup.js","tabgroup"],