1

Heyo,

I want to make the Customizer of my Theme look a bit different than usual. For example I want to make the width to 400px instead of 300px. Is there a way I can include custom-CSS for that?

Thanks in advance!

1 Answer 1

1

Definitely, you can use the customize_controls_enqueue_scripts hook to load custom CSS and JS.

This is an example of making the panel 400px:

File: sample-theme/css/customizer-controls.css

.wp-full-overlay.expanded {
    margin-left: 400px;
}
.wp-full-overlay-sidebar {
    min-width: 400px;
}
.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
    margin-left: -400px;
}

File: sample-theme/functions.php

/**
 * Enqueue style for customized customizer.
 */
 function sample_theme_customize_enqueue() {
     wp_enqueue_style( 'custom-customize', get_theme_file_uri( 'css/sample-theme-customizer-controls.css' ) );
 }

 add_action( 'customize_controls_enqueue_scripts', 'sample_theme_customize_enqueue' );
1
  • 1
    @Pelle2010 Beware that the width of the Customizer pane will likely become variable in the future, and it already is today. Take note of make.wordpress.org/core/2017/05/16/… Commented Jul 28, 2017 at 22:00

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.