Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wagerfield/gulp-spritezero
Gulp plugin for spritezero
https://github.com/wagerfield/gulp-spritezero
Last synced: 6 days ago
JSON representation
Gulp plugin for spritezero
- Host: GitHub
- URL: https://github.com/wagerfield/gulp-spritezero
- Owner: wagerfield
- License: mit
- Created: 2016-05-17T12:38:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-31T01:43:42.000Z (over 4 years ago)
- Last Synced: 2024-12-05T13:06:27.228Z (23 days ago)
- Language: JavaScript
- Size: 212 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-spritezero
[Gulp][gulp] plugin for generating spritesheets using [spritezero][spritezero] for [Mapbox][mapbox].
## Install
```
npm install gulp-spritezero
```## Usage
The following gulp task will generate `dest/sprite.png` and `dest/sprite.json` from all **SVG** files in the `src` directory.
```
var gulp = require('gulp');
var spritezero = require('gulp-spritezero');gulp.task('spritezero', function() {
return gulp.src('src/**/*.svg')
.pipe(spritezero({
scales: [ 1 ]
}))
.pipe(gulp.dest('./dest'));
});
```If no options are passed to the plugin, 4 files will be generated by default:
* `dest/sprite.png`
* `dest/sprite.json`
* `dest/[email protected]`
* `dest/[email protected]`## Options
| Key | Value Type | Default | Description |
| -------- | ---------------- | ---------- |---------------------------------------- |
| `scales` | `Array.` | `[ 1, 2 ]` | Array of scales to generate sprites for |
| `name` | `String` | `'sprite'` | Base name for the sprite files |
| `sdf` | `Boolean` | `false` | Render the sprites in [SDF][sdf] format |## Author
Matthew Wagerfield: [@wagerfield][twitter]
## License
Licensed under [MIT][mit]. Enjoy.
[twitter]: http://twitter.com/wagerfield
[mit]: http://www.opensource.org/licenses/mit-license.php
[gulp]: http://gulpjs.com/
[spritezero]: https://github.com/mapbox/spritezero
[mapbox]: https://www.mapbox.com/
[sdf]: https://www.mapbox.com/blog/text-signed-distance-fields/