gensprite
v1.1.4
Published
<p align="center"> <img src="https://raw.githubusercontent.com/vasbaz/assets/master/gensprite/gensprite-logo.svg" alt="gensprite logo" width="72" height="72"> </p>
Downloads
13
Maintainers
Readme
Installation
npm install --save-dev gensprite
Using
All that is needed for the library to work is:
- Folder with svg files
- The html page in which the svg sprite will be inserted
Launch occurs through the command line:
gensprite
Work parameters can be specified:
- Via command line arguments
- In package.json of your project in
"gensprite"
property
| Parameter | cli | package.json
| Default |
| --------------------------------- | --------------------- | -------------- | -------------- |
| The path to the image folder | --img
or -i
| "imgFolder"
| ./src/assets/img
|
| The path to the "index" page | --output
or -o
| "indexFile"
| ./src/index.html
|
| Sprite tag id | --spriteId
or -s
| "spriteId"
| svg-sprite
|
Core concepts
Tiny gen sprite uses <symbol>
way to make svg sprites.
Examples
Launch with command line arguments
gensprite -o="./index.html" --img="./images"
Parametrs in package.json
:
{
"name": "example-project",
"version": "1.0.0",
"gensprite": {
"imgFolder": "./src/images/svg",
"spriteId": "my-sprite"
}
}
License
MIT