Skip to content

thomastloberg/SVGLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Javascript SVGLoader

Why

No simple way of coloring an SVG file without putting the whole SVG data inside your HTML-rendered file.
With this solution you can implement an small i-element and just as easily change icon by changing the class names.

How

A way to implement FontAwesome logiq to all your existing svg files.

Configuration

Modify SVGLoaderPrefix, Prefix and SVGPath to suit your project.
All attributes provided into the i-element will be passed onto the SVG data.

Include script in HTML header like this:
<script type="text/javascript" src="proxy.php?url=https%3A%2F%2Fgithub.com%2Fsrc%2Fjs%2FSVGLoader.js%3Fv%3D1.0.0" defer></script>

Example usage:

<i class="lo-icon lo-profile" title="Profile icon"></i>

Output:

<!-- <i class="lo-icon lo-profile" title="Profile icon"></i> -->
<svg class="lo-icon lo-profile" title="Profile icon"><path...></svg>

About

A way to replace i-tags with SVG data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors