Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nass600/icomoon-builder
Update your icons library project from the zip generated by icomoon
https://github.com/nass600/icomoon-builder
build-tool css export icomoon less nodejs scss stylus
Last synced: about 1 month ago
JSON representation
Update your icons library project from the zip generated by icomoon
- Host: GitHub
- URL: https://github.com/nass600/icomoon-builder
- Owner: nass600
- License: mit
- Created: 2017-11-22T18:11:23.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-14T17:34:54.000Z (over 6 years ago)
- Last Synced: 2024-04-14T06:27:22.150Z (9 months ago)
- Topics: build-tool, css, export, icomoon, less, nodejs, scss, stylus
- Language: JavaScript
- Homepage:
- Size: 564 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# icomoon-builder
[![Build Status](https://api.travis-ci.org/nass600/icomoon-builder.svg?branch=master)](https://travis-ci.org/nass600/icomoon-builder)
[![npm](https://img.shields.io/npm/v/icomoon-builder.svg)](https://www.npmjs.com/package/icomoon-builder)
[![npm](https://img.shields.io/npm/dt/icomoon-builder.svg)](https://www.npmjs.com/package/icomoon-builder)Update your icons library project from the zip generated by [icomoon](https://icomoon.io/).
> Currently working only for SASS.
If you are developing your own icons library using the Icomoon tool and you find yourself doing the below process all the time this project might be useful for you.
#### Normal process
1. Download the zip file from icomoon.
2. Uncompressing it.
3. Copy pasting parts of code into your own.
4. Moving files to the location you want.
5. Minify the css file.#### Process with icomoon-builder
1. Download the font from icomoon.
2. Run `icomoon-builder`.## Features
+ Uncompress the icomoon generated zip file for you.
+ Pick the location where the fonts styles will be moved.
+ Choose where to move the pre-processed and css styles separately.
+ All references between all these files will be updated accordingly.
+ Minify the distribution css with `cssnano`.
+ Update the font family name with the one you chose.
+ Will keep your `selection.json` generated by icomoon so you can resume your work.
+ And many more (below examples).## Installation
```bash
npm install --save-dev icomoon-builder
```## Usage
You can run it directly in your terminal with Node:
```bash
node node_modules/.bin/icomoon-builder export
```Or add it as a script in your `package.json`:
```json
"scripts": {
"import": "icomoon-builder export"
}
```And then run it:
```bash
npm run import
```## Examples
### Export
Considering the following files are the ones icomoon generates and compresses:
```
.tmp/
├── demo-files
| ├── demo.css
| └── demo.js
├── demo.html
├── fonts
| ├── icomoon.svg
| ├── icomoon.ttf
| └── icomoon.woff
├── Read Me.txt
├── selection.json
├── style.css
├── style.scss
└── variables.scss
```When running:
```bash
cd your/path/to/fancy-icons-project/
node node_modules/.bin/icomoon-builder export fancy-icons ~/Downloads/icomoon.zip scss css fonts docs
```We will obtain:
```
target/
├── css
| ├── fancy-icons.css
| └── fancy-icons.min.css
├── docs
| ├── demo
| | ├── index.html
| | ├── scripts.js
| | └── styles.css
| └── icomoon.json
├── fonts
| ├── fancy-icons.svg
| ├── fancy-icons.ttf
| └── fancy-icons.woff
└── scss
├── fancy-icons.scss
├── _icons.scss
└── _variables.scss
```The `export` command does not destroy directories so if you have more files in the destination folders they will remain the same.
The following is the list of files copied:
| From | To | Operations performed |
| -------------------------- | ------------------------------------------- | ------------------------------------------------------------------ |
| .tmp/demo.html | fancy-icons-project/docs/demo/index.html | Updated references to assets |
| .tmp/demo-files/demo.css | fancy-icons-project/docs/demo/styles.css | |
| .tmp/demo-files/demo.js | fancy-icons-project/docs/demo/scripts.js | |
| .tmp/selection.json | fancy-icons-project/docs/icomoon.json | Renamed to icomoon.json |
| .tmp/style.css | fancy-icons-project/css/fancy-icons.css | Renamed to ``, updated references |
| | fancy-icons-project/css/fancy-icons.min.css | Minify the previous css |
| .tmp/fonts/line-icons.woff | fancy-icons-project/fonts/fancy-icons.woff | Renamed to `` |
| .tmp/fonts/line-icons.svg | fancy-icons-project/fonts/fancy-icons.svg | Renamed to `` |
| .tmp/fonts/line-icons.ttf | fancy-icons-project/fonts/fancy-icons.ttf | Renamed to `` |
| .tmp/style.scss | fancy-icons-project/scss/_icons.scss | Updated references and renamed `$icomoon-font-path` |
| .tmp/variables.scss | fancy-icons-project/scss/_variables.scss | |
| | fancy-icons-project/scss/fancy-icons.scss | Imports the other two scss files. Created if does not exist before |### Clean
> Careful, this command is destructive and cannot be undone.
Running:
```bash
cd your/path/to/fancy-icons-project/
node node_modules/.bin/icomoon-builder clean scss css fonts docs
```Will **remove entirely** the following folders:
+ your/path/to/fancy-icons-project/scss
+ your/path/to/fancy-icons-project/css
+ your/path/to/fancy-icons-project/fonts
+ your/path/to/fancy-icons-project/docs## Todo
- [x] SASS
- [ ] LESS
- [ ] Stylus## License
[MIT](LICENSE)
## Authors
+ [Ignacio Velazquez](http://ignaciovelazquez.es)