element-book
Version:
An [`element-vir`](https://npmjs.com/package/element-vir) drop-in element for building, testing, and demonstrating a collection of elements (or, in other words, a design system).
40 lines (35 loc) • 1 kB
JavaScript
import { css, html } from 'element-vir';
import { themeDefaultKey } from 'theme-vir';
import { viraTheme } from 'vira';
import { defineBookElement } from '../define-book-element.js';
export const BookEntryDescription = defineBookElement()({
tagName: 'book-entry-description',
styles: css `
:host {
color: ${viraTheme.colors['vira-grey-foreground-placeholder'].foreground.value};
display: inline-flex;
flex-direction: column;
gap: 8px;
}
:host(:hover) {
color: ${viraTheme.colors[themeDefaultKey].foreground.value};
}
p {
margin: 0;
padding: 0;
}
p:first-child {
margin-top: 8px;
}
code {
font-size: 1.2em;
}
`,
render({ inputs }) {
return inputs.descriptionParagraphs.map((paragraph) => {
return html `
<p>${paragraph}</p>
`;
});
},
});