Conversation
🦋 Changeset detectedLatest commit: 3a6b969 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR refactors the evo-card component to use a <define> pattern instead of a dynamic tag with <const> for switching between different HTML elements (span, anchor, button). This improves code readability and maintainability by making the conditional tag selection more explicit and declarative.
Changes:
- Replaced the IIFE-based
<const>block that returned tag names and attributes with a<define>block - Moved conditional logic for tag selection into explicit
<if>/<else>blocks within the<define>component - Simplified attribute spreading by directly applying them in each conditional branch
|
Is this a pattern we'd want to apply to all components when tag switching occurs? If so should we document it in a style guide or somewhere? |
|
Good idea @ianmcburnie! I don't think it makes sense to put in a style guide for this repo, but it's a cool thing to put in some kind of "recommended patterns" doc on the Marko site |
5772a45 to
3a6b969
Compare
Use a
<define>pattern for switching between tags, instead of a dynamic tag with a<const>