2.5.3 • Published 1 year ago

@devcapsule/adapter v2.5.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Sample Usage

import { Adapter } from `https://cdn.jsdelivr.net/npm/@devcapsule/adapter/+esm`;

const cardStyle = `
   display: block;
   min-height: 5rem;
   width: 100%;
   color: red;
`;

class Card extends Adapter {
   /** Style is isolated in defined tag name. */
   static css = cardStyle;
};

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

/**
 * More style can be added later, class can also be used.
 * This will render CSS as `el-card.text-blue { color: blue }`
 */
Card.addStyle(`
   &.text-blue { color: blue }
`);

/** Replace component styles with the base style `cardStyle`,
 * This is just one from many way to do it.
 */
Card.css = cardStyle;

/** Dynamically create stylable element <el-card>
 * which inherit all styles from `Card`
 */
const card = new Card();

/** <el-card> object has the same API as `Card`
 * but style will be specific for this element only.
 */
card.css = `display: flex;`;
card.addStyle(`color: black;`);
document.body.append(card);

Software Development šŸ’»

Project Board

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

Prerequisites

Prerequisites for document creation.

šŸ› ļø Setup

  1. Clone repository from github
$ git clone https://github.com/keenlycode/adapter.git
$ cd adapter
  1. Install node dependencies
$ npm install

šŸ—ƒļø Build Library

# Build
$ npm run dist

šŸ” Run Test

$ npm run test

Document Creation (Python šŸ)

$ python -m venv venv
$ source venv/bin/activate
$ pip install -r require.pip
$ npm run docs

Special Thanks

2024-01-09

  • Joe Pea: for a lot of suggestions at the very beginning about Mixin, Style Rendering and Shadow DOM. Knowing him by chance when I found interesting project : Lume.io šŸ‘ļø

2.5.3

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.5.0

1 year ago

2.4.14

1 year ago

2.4.16

1 year ago

2.4.15

1 year ago

2.4.13

1 year ago

2.4.10

1 year ago

2.4.12

1 year ago

2.4.11

1 year ago

2.4.7

1 year ago

2.4.9

1 year ago

2.4.8

1 year ago

2.4.6

1 year ago

2.4.5

1 year ago

2.4.1

1 year ago

2.4.3

1 year ago

2.4.2

1 year ago

2.4.4

1 year ago

2.4.0

1 year ago

2.3.5

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.2

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.0

2 years ago

2.0.0

2 years ago