1

I'd want for my Customizer to use a custom skin, or, well, enhancements as one would call it.

Unfortunately, WP_Customize_Control doesn't do the job, nor can I find anything about it.

What would be the docs / resources to start building this?

1 Answer 1

2

If you're after getting custom CSS ontop of Wordpress's Admins Customizer buttons, inputs, and controls - you can do something like this:

add_action( 'admin_enqueue_scripts', function(){
    $screen = get_current_screen();
    if ($screen->base == 'customize') {
        wp_register_style( 
            'custom_wp_admin_css', 
            plugins_url( 'your-file.css', __FILE__ ),
            //get_template_directory_uri().'your-file.css',
            false, 
            filemtime( plugin_dir_path( __FILE__ ) . '/your-file.css' )
            // get_template_directory() . '/your-file.css' )
        );
        wp_enqueue_style( 'custom_wp_admin_css' );
    }
});

The commented out lines are incase your making a theme, not a plugin.

In your-file.css, you can then do your custom CSS

#customize-controls * {
    color: red !important;
}
2
  • Thank you, do I have to use !important on each declaration? Isn't there a way to make my file of higher-order? Jan 9, 2018 at 3:13
  • 1
    Actually you should just enqueue at the customize_controls_enqueue_scripts action. No need then to check for the current screen. Jan 9, 2018 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.