
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
grunt-svg-toolkit
Advanced tools
A toolkit for working with, styling and converting SVG files.
SVG Toolkit helps you work with SVG files by normalizing, colorizing, styling and optionally converting them to other formats, ready for production use.
A few example uses:
Create colorized SVGs and PNGs across an entire SVG icon set. Colors in your design changing? No problem... update your grunt file and re-run. Done. No need to open your design tools to update and re-export all your assets.
Use a CSS file to generate customized, themed SVG and PNG output assets.
SVG markup cleanup and normalization, decreasing asset size and increasing performance.
Vector workflow powerup ProTip:
SVG Toolkit works great with the output generated from our Illustrator SVG Exporter!
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install --save-dev grunt-svg-toolkit
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-svg-toolkit');
Run this task with the grunt svgtoolkit
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
svgtoolkit: {
dist: {
options: {
generatePNGs: true,
style: 'src/css/themes/blue.css',
colorize: '#808000',
debug: false
},
files: [
{
expand: true,
cwd: 'src/icons/',
src: '**/*.svg',
dest: 'dist/icons'
}
]
}
Type: Boolean
Default: true
Should PNGs be generated.
Type: String
Default: undefined
The location of a CSS file that should be applied to the SVG files. Great for creating a theme across an icon set and generating a matching set of SVGs/PNGs.
Type: String
Default: undefined
Define a hex color value (e.g. #d8dfd8) or HTML color name (e.g. thistle) to colorize the SVG files by setting their stroke
and fill
attributes. Great for colorizing a set of icons.
Note: The
colorize
setting, if set, will override thestyle
setting.
Type: Boolean
Default: false
Log task progress and details about the processing of each SVG.
<defs>
<style>
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);
</style>
</defs>
Your feedback is most welcome.
Have a troublesome SVG you are using that isn't generating the output you'd expect? Open an issue with the details and include the SVG markup for us to test with.
Have an awesome idea for a new feature or additional output format that would be useful? Create a feature request
issue describing it, or even better... send a pull request!
Bugs? You know what to do.
This project is the result of abstracting and generalizing the icon production process tools used in building Iconic, and to open source those pieces that might be more widely useful and applicable to the design and development communities.
Copyright (c) 2015 Waybury, contributors. Licensed under the MIT license.
FAQs
> A toolkit for working with, styling and converting SVG files
The npm package grunt-svg-toolkit receives a total of 2 weekly downloads. As such, grunt-svg-toolkit popularity was classified as not popular.
We found that grunt-svg-toolkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.