// SVG: // Basic configuration example for SVG Sprite var config = { shape : { dimension : { // Set maximum dimensions maxWidth : 32, // Max. shape width maxHeight : 32, // Max. shape width precision : 2, // Floating point precision attributes : true, // Width and height attributes on embedded shapes }, spacing : { // Spacing related options padding : 0, // Padding around all shapes box : 'content' // Padding strategy (similar to CSS `box-sizing`) }, dest : 'intermediate-svg' // Keep the intermediate files }, svg : { // General options for created SVG files xmlDeclaration : false, // Add XML declaration to SVG sprite doctypeDeclaration : false, // Add DOCTYPE declaration to SVG sprite namespaceIDs : true, // Add namespace token to all IDs in SVG shapes dimensionAttributes : true, // Width and height attributes on the sprite rootAttributes: { width: 0, height: 0, style: 'position:absolute; background:none !important' }, }, mode : { view : { // Activate the «view» mode bust : false, render : { scss : true // Activate Sass output (with default options) } }, css : { example : true }, inline : true, symbol : true // Activate the «symbol» mode } }; // Build SVG sprites and move to build folder gulp.task('svgSprite', function() { return gulp.src('assets/svg/*.svg') .pipe(svgSprite(config)) .pipe(gulp.dest('assets/build/svg')) .pipe(notify({ message: 'SVG task complete'})); }); // Images: Removes images not in src folder gulp.task('cleanSVG', function(){ del(['assets/build/svg/**/*', '!assets/svg', '!assets/svg/**/*']) }); // Rename and create symbols php file gulp.task('rename', function() { return gulp.src('assets/build/svg/symbol/svg/*.svg') .pipe(rename({ basename: "svg", suffix: "-symbols", extname: '.php' })) .pipe(gulp.dest('parts')) .pipe(browserSync.stream()) .pipe(notify({ message: 'Rename task complete'})) });