A Packaged Polymer element that encapsulates font awesome
- bower install poly-fa
<link rel="import" href="<path-to-bower-components>/poly-fa/fa.html">
<dom-module id="example-element">
<template>
<style include="poly-fa">
<!--scoped styles apart from fa-->
</style>
<!-- your element's DOM -->
</template>
</dom-module>
- Fetches Font Awesome from the most recent distribution branch and packages it as a style module for use in polymer custom elements
- Uses the Polymer Web Tool to package your external styles
Service Worker
- Can Register a Service Worker fa_sw.js on the first run
- Hijacks requests to Polymer Web Tool, and caches it in the service worker cache
To have the service worker, change your usage like so:
- browse to bower_components/poly-fa
cp fa_sw.js /fa_sw.js
<link rel="import" href="<path-to-bower-components>/poly-fa/fa.html">
<dom-module id="example-element">
<template>
<style include="poly-fa">
<!--scoped styles apart from fa-->
</style>
<poly-fa register-sw>
<!-- your element's DOM -->
</poly-fa>
</template>
</dom-module>
- For Service worker to work, you should serve via SSL/TLS
If you already have an existing service worker,
- Use importScripts(
<path-to-bower-components>/poly-fa/fa_sw_vanilla.js
) before your service worker handles fetches