sass-svg-inline
v1.0.1
Published
Inline SVG for Sass
Downloads
1
Readme
Sass SVG Inline
Installation
npm i sass-svg-inline
Example
gulpfile.js
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const svg = require('sass-svg-inline');
function buildStyles() {
return gulp.src('./sass/**/*.scss')
.pipe(sass({
functions: {
'svg($path)': svg.setDir('./img')
}
}).on('error', sass.logError))
.pipe(gulp.dest('./css'));
}
gulp.task('buildStyles', buildStyles);
gulp.task('default', gulp.series('buildStyles'));
sass/style.scss
.circle {
background-image: svg('circle.svg');
height: 64px;
width: 64px;
}