Skip to content

Instantly share code, notes, and snippets.

@fstbraz
Created August 30, 2022 21:13
Show Gist options
  • Save fstbraz/5c5e35673f2f23b1d8ecc1b726fd00b9 to your computer and use it in GitHub Desktop.
Save fstbraz/5c5e35673f2f23b1d8ecc1b726fd00b9 to your computer and use it in GitHub Desktop.
cross-framework-web-components-2
...
@customElement('card-image')
export class Card extends LitElement {
@property({ type: Object }) card!: CardConfig;
render() {
return html`
<li class="card">
<div class="img">
<img src="${this.card.image}" alt="${this.card.altText}" />
</div>
<div class="text">
<h2>
<a id="card-link" href="${this.card.link}" aria-describedby="desc-a-card"
>${this.card.title}</a
>
</h2>
<p>${this.card.text}</p>
<span class="cta" aria-hidden="true" id="desc-a-card">${this.card.ctaText}</span>
<small><a href="${this.card.textDescLink}">${this.card.textDesc}</a></small>
</div>
</li>
`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment