- Install node.js: http://nodejs.org/
- Install grunt.js: http://gruntjs.com/getting-started
- In the Terminal:
$ cd [directory]
- Either create
package.json
and use data in this gist'spackage.json
, or run$ npm init
and folow the steps - Make sure to add
"grunt": "latest"
indevDependencies
if you usenpm-init
to create thepackage.jason
file - Install Grunticon in the project:
$ npm install --save-dev grunt-grunticon
- Create
Gruntfile.js
and use data from theGruntfile.js
in this gist. Tweak grunticon file paths as needed. - Put some .svg icons in the
src
directory defined in the Gruntfile - (Make sure you
$ cd
to the project directory)$ grunt
- MAGIC
Notes & Links:
- I still am pretty much a n00b when it comes to the command line and JS in general, so this may or may not be the right way to do it. But this did work for me.
- https://github.com/filamentgroup/grunticon
- documentation here assumes good working knowledge of grunt.js and JS in general (which I do not have, hence the cursing)
- http://merrickchristensen.com/articles/gruntjs-workflow.html
- this article gave me vital clues on properly setting up and configuring Grunt, particularly the
Gruntfile
. - I was getting nothing but errors in the command line until I figured out that:
- I needed to wrap everything in the
Gruntfile
insidemodule.exports = function(grunt) { };
- and the grunticon stuff needed to be inside of
grunt.initConfig({ });
- That's the assumed knowledge stuff that was tripping me up
- I needed to wrap everything in the
- this article gave me vital clues on properly setting up and configuring Grunt, particularly the
- Figure out how to load the different stylesheets grunticon produces
- I'd rather not load them as separate stylsheets using their javascript utlity.
- I'd prefer to incorporate them into my SASS workflow
- You can chnage the filenames of the CSS files grunticon generates, so cangeing them to .scss files is easy enough
- Could use nested
@imports
:.no-svg{@import "icon-png.scss";}
- May also need to check out this fork of grunticon for SASS
- Clone myself