gulp-base64-stylus
v0.0.4
Published
gulp-base64-stylus is a gulp plugin that convert image to base64 on stylus (or sass)
Downloads
3
Readme
gulp-base64-stylus
gulp-base64-stylus is a gulp plugin that convert image to base64 on stylus (or sass)
install
npm install gulp-base64-stylus --save
prepare
put all image
.
├── src ├── images
├── [email protected]
├── [email protected]
├── [email protected]
gulp task
gulp.task('convert',function(){
gulp.src('./src/images/')
.pipe(convertBase64({output:'_image.styl',sass: false}))
.pipe(gulp.dest(path.join(__dirname,'./src/style/')))
})
use on stylus
@import "./_image.styl"
.sample-class
$sample1()
for retina
sample_image.png // normal image size
[email protected] // retina image size