change accordion button color when panel is active
razked opened this issue · 2 comments
razked commented
Hi i would like to change the accordion button text color when the panel is open. is there a way to achive this ?
tnx.
mistermendez commented
you could use CSS
.accordion__button[aria-expanded='true'],
.accordion__button[aria-selected='true'] {
color: red
}
or AccordionItemState
<AccordionItemButton>
This item is
<AccordionItemState>
{({ expanded }) => (expanded ? 'expanded' : 'collapsed')}
</AccordionItemState>
</AccordionItemButton>
katie-day commented
Hope that answers your question and I'm just closing this ticket for now, but please reopen to discuss further