All Projects → itsmattsoria → killersvgworkflow

itsmattsoria / killersvgworkflow

Licence: other
Demo project for a Killer SVG Workflow

Programming Languages

ApacheConf
554 projects
CSS
56736 projects
PHP
23972 projects - #3 most used programming language
javascript
184084 projects - #8 most used programming language

###Killer SVG Workflow###

See the demo at http://mattsoria.com/killersvgworkflow/

Dependencies:

Instructions

After you have Grunt installed on your machine, clone the repo and navigate to the assets directory and run npm install to install the Grunt plugins used. After that just run grunt from the project root and you're good to go!

From there you can save SVG files to the assets/svgs folder, making sure to save them with the prefix of icon-, and you can use the SVGs anywhere with the ability to style them with CSS, and the confidence that a fallback PNG will be generated for IE8.

To use the SVG icons throughout the project you'll want to include the defs file at the top of your document, just after the opening <body> tag, and hide it so they don't all just show up at the top of your document:

<span class="hide"><?php include_once("assets/svgs/build/svg-defs.svg"); ?></span>

Just hide that baby with something like .hide{display:none;}.

Then you can embed the SVG icons throughout your project following this format:

<svg class="icon icon-mysvg" role="img" aria-labelledby="title"><use xlink:></use></svg>

For a closer look at how it works and some more notes that will help you get started, see the demo page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].