Skip to content

gabriel-jm/lithen-super-element

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Super Element class of Lithen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages