Skip to main content
deleted 2 characters in body
Source Link
David Sword
  • 3.4k
  • 1
  • 14
  • 29

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' );
    }
});

InThe commented out lines are incase your-file making a theme, not a plugin.css

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

#customize-controls * {
    color: red !important;
}

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

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' );
    }
});

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

#customize-controls * {
    color: red !important;
}

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

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;
}
Source Link
David Sword
  • 3.4k
  • 1
  • 14
  • 29

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' );
    }
});

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

#customize-controls * {
    color: red !important;
}

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