FlowingCode/FontAwesomeIronIconset

Separate the client-side part as a npm dependency

javier-godoy opened this issue · 1 comments

From thread in Vaadin Directory, Ivan Lun wrote:

Is it possible to use this also somehow in HTML/designer/PolymerTemplate? When I install this with Maven, I can see no additional component in the designer; and there is no NPM install documentation here.

It's posible to use the addon with Designer, but there is no separate web-component for the icons since they are just iron-icon with a custom iconset.

In order to use the icons with Designer, you'll need to import iron-icon and the corresponding iconset provided by this addon (fas.js, far.js or fab.js depending on whether the icon comes from the FontAwesome Regular, Solid or Brand)

What is currently NOT possible is to install the addon using npm, since the JS files are distributed in the JAR and extracted by vaadin. If you add the addon dependency in the pom file and then run mvn vaadin:prepare-frontend, it should extract the module so that it can be used as follow:

import '@polymer/iron-icon/iron-icon.js';
import '@vaadin/flow-frontend/font-awesome-iron-iconset/fab.js'; //or fas.js or far.js

<iron-icon icon="fab:font-awesome" style="width: 48px; height: 48px"></iron-icon>