Skip to content

Conversation

TommasoAllegretti
Copy link
Contributor

@TommasoAllegretti TommasoAllegretti commented Aug 23, 2024

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

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • (N/A) I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

Closes #40760

@mdo
Copy link
Member

mdo commented Apr 3, 2025

@julien-deramond Thoughts on linking to Collapse usage docs instead as mentioned?

@mdo mdo added this to v5.4.0 Apr 3, 2025
@mdo mdo removed this from v5.3.4 Apr 3, 2025
@github-project-automation github-project-automation bot moved this to Needs review in v5.4.0 Apr 3, 2025
@mdo mdo added this to v5.3.6 Apr 9, 2025
@github-project-automation github-project-automation bot moved this to To do in v5.3.6 Apr 9, 2025
@mdo mdo removed this from v5.4.0 Apr 9, 2025
@mdo
Copy link
Member

mdo commented Apr 9, 2025

Eh, it's a similar situation to tooltips/popovers, so going to just roll with it.

@mdo mdo force-pushed the accordion-javascript-docs branch from 9fe658a to 71b7c9a Compare April 9, 2025 05:25
@julien-deramond
Copy link
Member

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).

@julien-deramond julien-deramond force-pushed the accordion-javascript-docs branch from 71b7c9a to 2243be3 Compare April 21, 2025 12:34
@julien-deramond julien-deramond force-pushed the accordion-javascript-docs branch from 2243be3 to c7829b5 Compare April 21, 2025 12:37
@julien-deramond julien-deramond self-requested a review April 21, 2025 12:38
Copy link
Member

@julien-deramond julien-deramond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @TommasoAllegretti!
I’ve rebased your commit and adapted it to the updated Astro architecture, incorporating content from the Collapse component.

I haven’t yet managed to extract the content into a reusable form, but I’ve added a task for that to #41380 for future exploration.

I’m good with the changes.
@mdo, feel free to give it a final review and merge if all looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Document how to show/collapse/toggle an accordion item via Javascript
4 participants