1

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):

enter image description here

1

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; } – Ray Feb 27 '18 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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