CLI tool that takes a directory of SVG images and outputs a CSS file and a directory of PNG images as a fallback.
Want to see pretty graphs? Log in now!
npm install iconr
|1||downloads in the last day|
|49||downloads in the last week|
|65||downloads in the last month|
|Last Published By|
|Version||0.4.3 last updated a month ago|
|Keywords||svg, png, css, datauri, fallback|
|Dependencies (12)||cssbeautify, colors, microtime, mime, mkdirp, optimist, phantomjs, progger, q, rimraf, svgo, underscore|
Parses a directory of SVG images and outputs a CSS file of inlined data URIs as well as a directory of PNG images for fallback.
Usage: iconr [inputDirectory] [outputDirectory] -options Description: Parses a directory of SVG images and outputs a CSS file of inlined data URIs as well as a directory of PNG images for fallback. Options: -h, --help Output usage information -V, --version Output version number -a, --analytics Displays a summary of application process tasks -v, --verbose Verbose mode: log application progress to the console -d, --debug Debug mode: will output additional information for development -p, --pretty Output CSS in a "beautified" format -b, --b64 Base64 encode SVG data URI (fallback PNG is always Base64) -n, --nopng Suppress creation of PNG fallback images (needed for < IE7) -o, --optimizesvg Will attempt to optimize the SVG to minimize file size -c, --classname Set a prefix for css classes (default classname is SVG filename) -f, --filename Set filename of css output (default is iconr.css) -s, --stdout Use this to output to stdout instead of saving to a file -k, --killcomment Removes the "generated by iconr" CSS comment Examples: $ iconr ./svgIcons ./svgCss -vao $ iconr ./images/svg-icons ./css -pn --filename="svg-icons.css"
Expects Modernizr classes on front-end.
Contributing to Iconr
Contributions and pull requests are very welcome. Please follow these guidelines when submitting new code.
- For feature changes, update both jQuery and Prototype versions
npm install -dto install the correct development dependencies.
- Don't touch the
- Submit a Pull Request using GitHub.
Using CoffeeScript & Cake
First, make sure you have the proper CoffeeScript / Cake set-up in place. We have added a package.json that makes this easy:
npm install -d
This will install
Once you're configured, building the JavasScript from the command line is easy:
cake build # build Iconr from source cake watch # watch coffee/ for changes and build Iconr
If you're interested, you can find the recipes in Cakefile.
Released under the MIT License.