Create template from static html files with inline styles.
Make <web-components>
instead of <iframes>
!
Install with npm
npm install --save-dev html-to-template-loader
Import html to use in your custom element:
// use loader inline or place to your webpack module.rules
import templateHTML from 'html-to-template-loader!../html/banner.html';
const template = document.createElement('template');
template.innerHTML = templateHTML;
export class TopBanner extends HTMLElement {
constructor () {
// use your template...
}
}
- auto generate base64 from paths to local images
- auto generate base64 from paths to local fonts