Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cfware/icon-builder
Build `icons.js` in the target directory
https://github.com/cfware/icon-builder
Last synced: 29 days ago
JSON representation
Build `icons.js` in the target directory
- Host: GitHub
- URL: https://github.com/cfware/icon-builder
- Owner: cfware
- License: mit
- Created: 2020-09-21T23:32:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T02:01:56.000Z (about 1 year ago)
- Last Synced: 2024-11-18T04:17:05.516Z (about 1 month ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @cfware/icon-builder [![NPM Version][npm-image]][npm-url]
Build `icons.js` in the target directory.
## Usage
Create `./pkgs/icon/icon-chars.js`:
```js
export const iconChars = {
ban: '\uF05E',
'caret-down': '\uF0D7',
'caret-right': '\uF0DA',
download: '\uF019',
edit: '\uF044',
envelope: '\uF0E0',
'exclamation-triangle': '\uF071',
'id-card': '\uF2C2',
list: '\uF03A',
lock: '\uF023',
microphone: '\uF130',
'phone-alt': '\uF879',
plus: '\uF067',
'question-circle': '\uF059',
'sign-out-alt': '\uF2F5',
times: '\uF00D',
'trash-alt': '\uF2ED',
upload: '\uF093',
user: '\uF007'
};
```The exported object should have keys associated with Font-Awesome icon names,
values should be the Unicode point to produce for the WOFF2 font.```
npm i -D @cfware/icon-builder
npm i @cfware/shadow-element
npx cfware-iconbuilder ./pkgs/icon ./pkgs/icon/icon-chars.js iconChars
```This command will produce `./pkgs/icon/icon.js`. Importing that file will
register the custom element `cfware-icon`. An example usage is:
```js
const banIcon = () => html``;
```In addition `./pkgs/icon/fontawesome-free` will be created containing the
`package.json` and `LICENSE.txt` files installed by `@fortawesome/fontawesome-free`.[npm-image]: https://img.shields.io/npm/v/@cfware/icon-builder.svg
[npm-url]: https://npmjs.org/package/@cfware/icon-builder