Docs: add Usage section with JavaScript guide for Accordion component
Description
Added a section in the Accordion documentation to explain how to handle it via JavaScript, the section is almost identical to the one in the Collapse documentation (since it is the same) with a few minor changes.
It might be better to just link to the Collapse docs instead?
Type of changes
- Documentation enhancement (non-breaking change)
Checklist
- [x] I have read the contributing guidelines
- [x] My code follows the code style of the project (using
npm run lint) - [x] My change introduces changes to the documentation
- [x] I have updated the documentation accordingly
- (N/A) I have added tests to cover my changes
- [x] All new and existing tests passed
Live previews
Related issues
Closes #40760
@julien-deramond Thoughts on linking to Collapse usage docs instead as mentioned?
Eh, it's a similar situation to tooltips/popovers, so going to just roll with it.
Thoughts on linking to Collapse usage docs instead as mentioned? Eh, it's a similar situation to tooltips/popovers, so going to just roll with it.
As you mentioned, it's pretty much the same situation as with tooltips and popovers—the only real difference is that the word "tooltip" or "popover" is swapped out, and here it's just "collapse" instead. The content is nearly identical.
I don't mind the temporary duplication, though. We can always revisit this once the docs are migrated to Astro. It'll likely be easier to create reusable content there, especially since Hugo doesn’t handle nesting partials or shortcodes very well (at least from what I remember).