@weavedev/lit-fontawesome
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

lit-fontawesome

Build Status - Travis CI Test Coverage - Code Climate MIT NPM

Convert Fontawesome SVG definitions to LitElement compatible SVGs and data URLs for inline use and in CSS

Install

npm i @weavedev/lit-fontawesome

API documentation

We generate API documentation with TypeDoc.

API Documentation

Usage

Icons in your CSS and HTML

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>
`;

Options

Set custom colors and class-names

litFontawesome(
    faCoffee, // Icon
    // Options
    {
        // Custom class-names
        className: 'myClassName',
        
        // Custom colors
        color: 'palevioletred'
    }
);

License

MIT

Made by Paul Gerarts and Weave

Package Sidebar

Install

npm i @weavedev/lit-fontawesome

Weekly Downloads

146

Version

0.3.2

License

MIT

Unpacked Size

10.3 kB

Total Files

6

Last publish

Collaborators

  • weavebot