New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-svgstore

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-svgstore

Combine svg files into one with defs

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by0.85%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-svgstore

Combine svg files into one with defs. Read more about this in CSS Tricks article.

Options:

  • fileName — the name of result file
  • prefix — prefix for ids of the defs child elements
  • onlySvg — output only <svg> element without <?xml ?> and DOCTYPE
  • emptyFills - remove all fill="none" so they can be changed in css

Usage

The following script will combine circle.svg and square.svg into single svg file with defs.

var svgstore = require('gulp-svgstore')
var gulp = require('gulp')
var svgmin = require('gulp-svgmin')
gulp.task('default', function () {
  return gulp.src('test/fixtures/*.svg')
             .pipe(svgmin())
             .pipe(svgstore({fileName: 'icons.svg', prefix: 'icon-', onlySvg: false}))
             .pipe(gulp.dest('test/'))
})
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg>
  <defs>
    <g id="icon-circle">
      <circle fill="#fff" stroke="#1D1D1B" stroke-miterlimit="10" cx="20" cy="20" r="10"/>
    </g>
    <g id="icon-square">
      <path fill="#fff" stroke="#1D1D1B" stroke-miterlimit="10" d="M10 10h20v20h-20z"/>
    </g>
  </defs>
</svg>

Keywords

FAQs

Package last updated on 23 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc