This package has been deprecated

Author message:

This package is no longer maintained. Please use fontawesome-icon for Polymer 3 components instead.

polymer-font-awesome

1.0.0 • Public • Published

polymer-font-awesome

Loading fonts inside the dom-module of a web component is not supported. However, the FontAwesome CSS needs to be loaded inside the dom-module so that the styles are applied within the shadow DOM of the component. Therefore, the font needs to be loaded explicitly outside of the context of the dom-module.

This projects splits the FontAwesome stylesheet and embeds the CSS rules inside a custom style/style module, so they can easily be included in Polymer web components.

Usage

The project consists of two files:

  • font-face.html: Polymer custom style, which loads the actual fonts.
  • font-awesome.html: Polymer style module, which contains the FontAwesome CSS rules.

Both files must be loaded inside your component outside the dom-module definition:

<link rel="import" href="node_modules/polymer-font-awesome/dist/font-face.html">
<link rel="import" href="node_modules/polymer-font-awesome/dist/font-awesome.html">

<dom-module id="...">
...
</dom-module>

Additionally, the style module needs to be included in the template of your component as described in the Polymer docs:

<style type="text/css" include="font-awesome"></style>

Packaging

When using polymer-build to build your component, you must add the fonts as extra dependencies in polymer.json:

{
  "extraDependencies": [
      "node_modules/polymer-font-awesome/dist/fonts/*"
  ]
}

License

Readme

Keywords

none

Package Sidebar

Install

npm i polymer-font-awesome

Weekly Downloads

6

Version

1.0.0

License

(OFL-1.1 AND MIT)

Last publish

Collaborators

  • soldag