Open nmerget opened 3 months ago
@nmerget could you please provide a link to an article, gist or whatever, if a ressource like this already exists?
Behaviour multiple
can be implemented with checkboxes. Behaviour single
requires radio buttons.
A pure CSS solution unfortunately seems limited to me: Since radio buttons cannot be unchecked without JS, there is no way to close the opened item by clicking on it (behaviour single
).
Both variants can be seen here: https://codepen.io/alvarotrigo/pen/dyJbqpd
We should consider switching to details/summary for accordion to get rid of the JS implementation for Accordion.
Initially saw it here: https://daisyui.com/components/accordion/ (working with CSS only)
^----- Current idea from my side:
In case of using this, we would need to further enhance it via
aria-
-attributes. Or keep the existingdetails/summary
, if we know the timeline regarding Firefox'sname
-attribute support.