Created
August 30, 2022 21:13
-
-
Save fstbraz/5c5e35673f2f23b1d8ecc1b726fd00b9 to your computer and use it in GitHub Desktop.
cross-framework-web-components-2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@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