lithen-super-element
TypeScript icon, indicating that this package has built-in type declarations

5.1.1 • Public • Published

Lithen - Super Element

Lithen is a set of simple tools, that anyone could have built, to use with Web Components. They can be used alone, so it's provided separately.

Super Element is a class used to create Web Components, it provides some features to make Web Components usage a bit simple. But it not focus on change the aproach of using the Web Components, like implementing reactivity and the like, its a bit like a syntax sugar.

This package uses ESModules.

Usage

import { SuperElement } from 'lithen-super-element'

class AppElement extends SuperElement {
  constructor() {
    super()

    this.applyRender()
    this.init()
  }

  init() {
    this.select('p').className = 'text'
  }
  
  styling() {
    return `
      .text {
        color: #d45;
      }
    `
  }

  render() {
    return '<p>Element using Lithen</p>'
  }
}

customElements.define('app-element', AppElement)

SuperElement methods and attributes

Other libs that are part of Lithen

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i lithen-super-element

    Weekly Downloads

    1

    Version

    5.1.1

    License

    MIT

    Unpacked Size

    37.5 kB

    Total Files

    63

    Last publish

    Collaborators

    • gabriel.jose