diff --git a/src/widget.js b/src/widget.js index cfd788f..14505c9 100644 --- a/src/widget.js +++ b/src/widget.js @@ -148,13 +148,16 @@ Widget.prototype = { * @private */ createHtmlTemplate () { - const element = document.createElement('div'); - const style = document.createElement('style'); - style.innerHTML = require('raw!./assets/styles.css'); + const head = document.getElementsByTagName('head')[0]; + const style = document.createElement('link'); + style.type = 'text/css'; + style.rel = 'stylesheet'; + style.href = '/assets/styles.css'; + head.appendChild(style); - element.id = "remotestorage-widget"; + const element = document.createElement('div'); + element.id = 'remotestorage-widget'; element.innerHTML = require('html!./assets/widget.html'); - element.appendChild(style); return element; },