Convert Fontawesome SVG definitions to LitElement compatible SVGs and data URLs for inline use and in CSS
npm i @weavedev/lit-fontawesome
We generate API documentation with TypeDoc.
You can use the Fontawesome icons in your HTML as inline SVGs, and in your CSS as data URLs.
import { css, html } from 'lit-element';
import { faCoffee } from '@fortawesome/free-solid-svg-icons/faCoffee';
import { litFontawesome, urlFontawesome } from '@weavedev/lit-fontawesome';
// Use it in your CSS
css`
.myCoffeeIcon {
background-image: url('${urlFontawesome(faCoffee)}');
}
`;
// Use it in your HTML
html`
<div>${litFontawesome(faCoffee)}</div>
`;
Set custom colors and class-names
litFontawesome(
faCoffee, // Icon
// Options
{
// Custom class-names
className: 'myClassName',
// Custom colors
color: 'palevioletred'
}
);
Made by Paul Gerarts and Weave