.
* Rotating accent color per nth-card via CSS counter.
*
*/
export class LitroCard extends Elena(HTMLElement) {
static tagName = 'litro-card';
static props = ['title', 'description', 'icon', 'iconsrc', 'href'];
title = '';
description = '';
icon = '';
iconsrc = '';
href = '';
render() {
const iconHtml = this.iconsrc
? `

`
: this.icon
? `
${this.icon}`
: '';
const descHtml = this.description
? `
${this.description}
`
: '';
const inner = `
${descHtml}
${this.innerHTML ? `
${this.innerHTML}
` : ''}
`;
const tag = this.href ? 'a' : 'div';
const hrefAttr = this.href ? ` href="${this.href}"` : '';
return html`
${unsafeHTML(`<${tag} class="card"${hrefAttr}>${inner}${tag}>`)}
`;
}
}
LitroCard.define();
export default LitroCard;