Support

Account

Home Forums Feature Requests Combine color picker swatches with theme.json Reply To: Combine color picker swatches with theme.json

  • Hey @proxxim ,

    in case you’re still wondering, I could easily just put it in a enqueued JS file that loads in the backend, and the colour picker only offers up theme colours which are defined for Gutenberg via theme.json. No need to wrap the code above, and you can easily enqueue the JS like normal (the CSS file is not needed though):

    function load_admin_stuff() {
    	wp_enqueue_style( 'admin_css', get_stylesheet_directory_uri() . '/css/admin.min.css', false, '' );
        wp_enqueue_script( 'admin', get_template_directory_uri() . '/js/admin.min.js', array(), '', true );
    };
    
    add_action( 'admin_enqueue_scripts', 'load_admin_stuff' );

    Can’t help you with the terms stuff, though I would suppose ACF just reads the values from Gutenberg, but doesn’t necessarily need Gutenberg to be loaded.