@devcapsule/deficon
v2.0.2
Published
SVG defs to icon component for web application
Downloads
7
Readme
DefIcon - 2.0.x
Website
https://keenlycode.github.io/deficon/
Usage
SVG Definitions to Icon Component for Web Application
// Javascript
import { DefIcon } from '@devcapsule/deficon';
class Icon extends DefIcon({
url: './icon.svg'}) {};
customElements.define('el-icon', Icon);
<!-- html -->
<el-icon name="audio-speakers"></el-icon>
Using Mixin
Mixin is more flexible and can extends other HTMLElement
Component.
// Javascript
import { DefIconMixin } from '@devcapsule/deficon';
class Icon extends DefIconMixin({url: './icon.svg'}, HTMLElement) {};
// The rest is the same.
customElements.define('el-icon', Icon);
// ...
Development
Environment Required
- NodeJS
- Python
Run Test
npm run test
Test in watch mode
npm run test-watch
Build documentation
npm run docs
Build distribution files
npm run dist