Skip to content

Conversation

arshinsikka
Copy link

… (#2691)

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:

  • Introduce a new id prop (type String, default '') on Card.vue

  • Bind that id prop as the id attribute on the root

    in the card template

  • No other behavioral changes—cards without an id continue to render as before

Anything you'd like to highlight/discuss:

  • The id prop is entirely optional; legacy usage is unaffected

  • This enhancement enables external linking or scripting against individual cards

Testing instructions:

  1. In any markdown page, add a card with an explicit id, e.g.:
Overview Content…
  1. Serve the site locally (markbind serve) and inspect the rendered HTML.

  2. Verify that the

    for that card has id="overview-card".

  3. Confirm that cards without an id continue to render without an id attribute.

Proposed commit message: (wrap lines at 72 characters)

feat(cardstack): add custom id prop and bind id attribute on Card.vue


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

@arshinsikka
Copy link
Author

Hi @Incogdino ! This PR adds a custom id prop to the component to support deep linking and styling. It includes updated docs and a visible test case in test_site. Let me know if anything needs clarification. Thanks!

@Incogdino
Copy link
Contributor

@arshinsikka Thank you for the contribution! However, your code changes do not reflect the requirements of the issue. The desired feature in #2691 is to have cards be redefined using a simple element tag without having to write out all the card stack code again. In short, write code for card stack once and define it everywhere.

You can refer to <include> feature for an idea of the requirements of the feature requested in #2691 and also for ideas of how this can be done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants