Instead of doing it that way I found a code snippet to add a new css file. Here is the new code:
function add_my_customizer_styles() {
wp_enqueue_style( 'my-customizer-css', trailingslashit( get_stylesheet_directory_uri() ).'assets/styles/customizer.css', null );
}
add_action( 'customize_controls_print_styles', 'add_my_customizer_styles', 99 );
That is working fine. Evidently, while the previous code works for some areas of the admin it didn’t work for the Customizer. This way I was able to make the customizer wider, too, which I’ve always wanted to do, by adding this additional CSS:
.wp-full-overlay-sidebar { width: 400px; }
.wp-full-overlay.expanded {margin-left: 400px; }
Problem solved!
Related Posts:
- How to add custom css to login and admin?
- What exact CSS minifier does WP core use?
- WordPress Dashboard is loaded without css
- Change css for tag in wordpress admin
- How to change text size on category pages
- prevent front end theme from injecting css into wp-admin
- No CSS being loaded on backend
- wordpress wp-admin css not loading
- Adjust the Device Preview sizes used in the WP 4.5 Customizer
- How do i use fontawesome icons in TinyMce editor?
- Add visit site to your toolbar instead of being in the dropdown
- How to hide menu on WordPress admin
- Simple/basic use of get_current_screen
- Is it possible to be more page/post specific with admin_enqueue_script?
- Gutenberg Block Editor Match Admin Styles & Frontend Styles
- What is better way to use Bootstrap inside admin panel?
- Hide Front-End Admin Bar Including 32 px Spacing
- Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies
- Deregister CSS style link ‘open-sans-css’
- How to add background image control to page admin controls?
- How to add a class to the element in a custom Gutenberg block
- enqueue admin styling and scripts only on plugin page
- Set admin body to ltr on a rtl installation
- Remove style `?ver=` from `/wp-admin/upgrade.php`
- editor-style.css Functionality
- Different css rules for TinyMCE and Gutenberg while using add_editor_style()
- Add css code in admin_enqueue_scripts
- Adding HTML tags or css classes to admin columns
- How To Differentiate Drafted product and Publish Product through Color?
- Admin WP List Table Columns Missing
- Load in wp admin assets from child theme
- Is it possible to switch Gutenberg’s editor styles when document settings change?
- Admin pages missing css
- How to apply a CSS file to my admin pages?
- Why is server preventing admin styles? (Was: Where are WordPress sessions saved?)
- how to add stylesheet to particular plugin only?
- Admin style for just one plugin in dashboard
- How to enable table overflow scroll? (especially order list table)
- Can’t resize logo in responsive theme?
- Dashicons and Pseudo :before
- How to disable the hover effect in WordPress and Elementor?
- How to stop my themes CSS changing the WordPress interface/?
- Distributing Frontend Assets with Plugins
- Adding CSS to admin TinyMCE editor for custom button
- make admin.css in my child theme
- hide elements of admin with css file
- dynamic css file for admin / backend and get_option results in Uncaught Error: Call to undefined function get_option()
- Notice-Updated div moving around unprompted
- WP components no style
- Gutenberg – Remove add block button
- Change the color of the Password Protected Post titles
- Is it possible to load the css just on my plugin admin page?
- Override Admin menu icon
- Enqueue a file that’s not js or css
- Apply custom css for user role
- How to reference an existing css content-based icon, within my admin menu hook
- Margin problem on management menu?
- Custom css author role
- Media Upload not working after hiding some elements from functions.php
- Restrict CSS on one page
- Button doesn’t work in the profile panel
- ACF Gut block broke wordpress default style?
- WordPress Sudden Loss of All CSS And Tons of JQuery Errors
- How can I add a stylesheet to the Classic Editor page?
- How to change the WordPress Plugin Watson Assistant Chatbot BOX Size?
- Stop custom Gutenberg styles taking over other admin bits?
- Twenty-seventy theme remove additional CSS from head
- Run function for specific user only
- Admin bar default color scheme for nonregistered/nonlogged users
- Lines of CSS only being delivered while logged in
- When admin is logged in, admin-bar-rtl.min.css is not loaded on website view (the admin-bar is shown in the footer without CSS)
- Style Radio Buttons inside Edit Page (Custom Fields)
- wp_is_mobile() inside js
- conditionally update css on edit.php
- Simple CSS admin pagination
- Adding custom css to a theme depending on whether the admin user is logged in or not
- Change Login CSS – Include instead of echo
- custom css in admin panel by user id
- theme injecting css into wp-admin
- Target “admins” with different styles on the front end [closed]
- Where are the Parent themes CSS & PHP files hidden on WordPress?
- Enqueue MCE Editor CSS in admin page
- CSS Styles specific to Admin Sidebar not loading
- React Material UI and WordPress Admin Area
- Custom customizer CSS priority
- RTL in WordPress or Elementor editor