Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/syuji-higa/gulp-stylus-sprites

Sprite image Gulp plugin for Stylus.
https://github.com/syuji-higa/gulp-stylus-sprites

gulp javascript

Last synced: 2 days ago
JSON representation

Sprite image Gulp plugin for Stylus.

Awesome Lists containing this project

README

        

gulp-stylus-sprites
===============

```
import gulp from 'gulp';
import filter from 'gulp-filter';
import stylusSprites from 'gulp-stylus-sprites';

gulp.task('sprite', () => {
const _imageDest = 'htdocs';
const _pngFilter = filter(['**/*.png'], { restore: true });
const _stylFilter = filter(['**/*.styl'], { restore: true });

gulp.src('./sprite/**/*.png')
.pipe(stylusSprites, {
imagesSrcBase: `${ __dirname }/sprite`,
})
.pipe(_pngFilter)
.pipe(gulp.dest(_imageDest))
.pipe(_pngFilter.restore)
.pipe(_stylFilter)
.pipe(cache('stylus'))
.pipe(gulp.dest(SPRITE_CSS_DEST))
.pipe(_stylFilter.restore);
});
```