How to use the lit-element/lit-element.customElement function in lit-element

To help you get started, we’ve selected a few lit-element examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github origami-cms / cms / packages / admin / src / components / ui / AppIcon / index.ts View on Github external
import { customElement, html, LitElement, property } from 'lit-element/lit-element';
import CSS from './app-icon-css';


export type Icon = string | {
  type: string;
  color: string;
  background: string;
};

@customElement('ui-app-icon')
export class AppIcon extends LitElement {

  public static styles = [CSS];

  @property()
  public icon?: Icon;

  @property({ reflect: true, type: Boolean })
  public shadow?: Icon;

  public render() {
    if (!this.icon) return html``;

    const icon = typeof this.icon === 'string'
      ? html`<img class="rounded" src="${this.icon}">`
      : html`