- Install node.js: http://nodejs.org/
- Install grunt.js: http://gruntjs.com/getting-started
- In the Terminal:
$ cd [directory] - Either create
package.jsonand use data in this gist'spackage.json, or run$ npm initand folow the steps - Make sure to add
"grunt": "latest"indevDependenciesif you usenpm-initto create thepackage.jasonfile - Install Grunticon in the project:
$ npm install --save-dev grunt-grunticon - Create
Gruntfile.jsand use data from theGruntfile.jsin this gist. Tweak grunticon file paths as needed. - Put some .svg icons in the
srcdirectory defined in the Gruntfile - (Make sure you
$ cdto 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
Gruntfileinsidemodule.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
