annibuliful / adapter

Adaptive Style Web Components

Home Page:https://keenlycode.github.io/adapter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

✨ Adapter πŸŽ‰

Adaptive Style Web Component Framework

  • Built with ❀️
  • Just 1 kB (minified + gzip)

Sample Usage

import { Adapter } from `@devcapsule/adapter`;

class Card extends Adapter {};

// Don't worry about tag's name conflicted, choose your own.
Card.define('el-card');

/* Style is isolated with defined tag name.
 * It won't go anywhere outside the component.
 * All <el-card> style will be updated.
 */
Card.addStyle(`
   display: block;
   min-height: 5rem;
   width: 100%;
   color: red;`
);

// Style class can also be used.
// This will style <el-card class="text-blue">
Card.addStyle(`
   &.text-blue {
      color: blue;
   }
`);

// Dynamically create stylable element.
const card = new Card();
card.addStyle(`color: black`);
document.body.append(card);

Project Board

https://github.com/orgs/keenlycode/projects/2

Software Development πŸ’»

Prerequisites

πŸ› οΈ Setup

  1. Clone repository from github
$ git clone https://github.com/keenlycode/adapter.git
$ cd adapter
  1. Install node dependencies
$ npm install
  1. Setup Python environment & libs
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r require.pip

πŸ—ƒοΈ Build Library

# Build
$ npm run dist

πŸ“• Build & Run Docs Server

$ npm run docs

πŸ” Run Test

$ npm run test

About

Adaptive Style Web Components

https://keenlycode.github.io/adapter/

License:ISC License


Languages

Language:TypeScript 59.5%Language:JavaScript 20.3%Language:HTML 16.8%Language:CSS 3.3%