Is it possible to change the color of a panel/section link in the WordPress customizer? Like so (example image is from a default installation but I'm talking about adding it to a custom section of course):
1 Answer
Yes, it's possible to change the color and other CSS properties of a section and panel title/link. You just have to figure the CSS selector. Here's the selector pattern for section and panel.
#accordion-section-SECTION_ID_GOES_HERE .accordion-section-title {
/* add CSS properties here */
}
#accordion-panel-PANEL_ID_GOES_HERE .accordion-section-title {
/* add CSS properties here */
}
Say, you have a panel example_panel
and a section example_section
then the selectors will be like the following -
#accordion-section-example_section .accordion-section-title {
background-color: tomato;
border-left-color: tomato;
color: #fff;
}
#accordion-panel-example_panel .accordion-section-title {
background-color: purple;
border-left-color: purple;
color: #fff;
}
Now if you save your custom CSS in a stylesheet customize-control.css
and want to enqueue that then you have to use customize_controls_enqueue_scripts
.
-
..and if anyone also wants to change the arrow color, then that can be done with:
#accordion-panel-example_panel .accordion-section-title::after { color:#fff; }
– RayCommented Feb 27, 2018 at 19:00