Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I want to insert into the Panel title (for a) small signs that indicate whether the accordion is collapsed or expanded, but I could not find the appropriate selectors. When the accordion is loaded (collapsed) there is no css class. There is an attribute aria-expanded="true" (which is not true in that state). After expanding the accordion, there is still no css class, but after closing again there is a class="collapsed".
It would help, to have the appropriate classes for the expanded and collapsed state.
Greetings Julius
Comments
Comment #3
thejimbirch CreditAttribution: thejimbirch commentedComment #4
thejimbirch CreditAttribution: thejimbirch commentedHi Julius,
I tried playing around with the classes, but could not get that to work without adding javascript.
Instead I simply changed the initial aria-expanded to false, which like you said it was any way. And now you can target the appropriate open/closed states with the following rules:
This is committed to the dev branch.
Thanks for the issue!
Jim
Comment #5
julius95 CreditAttribution: julius95 commentedThanks Jim, selecting an attribute would do it. Then the expanded class is not necessary any more.
Julius
Comment #6
thejimbirch CreditAttribution: thejimbirch commented