Skip to content

When implementing accordions in {bslib}, is there a way to change the color of the accordion icon (V) depending on whether the accordion is open or collapsed? #1109

Answered by gadenbuie
Shelmith-Kariuki asked this question in Q&A
Discussion options

You must be logged in to vote

It's possible but it's certainly not easy. Bootstrap uses an inline SVG in a CSS variable (--bs-accordion-btn-icon), and the color is customizable via Sass variables. So you'd have to write some custom Sass code to apply in these cases to get the exact look you want.

Here's the Bootstrap reference: https://getbootstrap.com/docs/5.3/components/accordion/#css

And bslib's Theming article can also provide some help.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Shelmith-Kariuki
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants