Skip to content

Converts SVG files to Fontawesome Javascript/Typescript icons.

License

Notifications You must be signed in to change notification settings

bdrops-GmbH/convert-svg-to-fontawesome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Convert SVG to Fontawesome Javascript/Typescript

Converts all SVG files in the same directory to Fontawesome Javascript & Typescript files.

Usage

Put your SVG icons and the script in the same folder and run:

php convert.php

Prerequisites

All SVG files have to be named in the following manner:

prefix_file_name.svg

❗The SVG file names must be lowercase snake case

Example

SVG source file:

z_my_icon.svg

Resulting icon CSS class:

<span class="z fa-my-icon"></span>

Resulting icon files:

zMyIcon.js
zMyIcon.d.ts

Example use

import { library, dom } from '@fortawesome/fontawesome-svg-core';

import { zMyIcon } from './icons/zMyIcon';

library.add(
    zMyIcon
);

dom.watch();

About

Converts SVG files to Fontawesome Javascript/Typescript icons.

Topics

Resources

License

Stars

Watchers

Forks

Languages