Deprecation warning: This module is no longer maintained and will not receive any further security updates or fixes.
grunt-saxicon is a wrapper for saxicon, a module which transforms SVGs into a SASS snippet that allows you to generate colorized SVGs (with both single or multi-colored shapes) within SASS, with each SVG embedded as a data-URI.
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 grunt-saxicon
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-saxicon');
Add the following to your Gruntfile.js
:
require('load-grunt-tasks')(grunt);
grunt.initConfig({
saxicon: {
foo: {
options: {},
files: {
'path/for/output.scss': 'path/to/svgs/*.svg'
}
}
}
});
Then in your SCSS files, import the SCSS output:
@include "path/for/output.scss";
Options are passed directly to the saxicon module. See the Saxicon Options documentation.
A smoketest is provided for integration purposes. For comprehensive tests, see the saxicon module.
grunt test