diff --git a/src/js/injectBaseStylesheet.js b/src/js/injectBaseStylesheet.js index 63fee620..353dead7 100644 --- a/src/js/injectBaseStylesheet.js +++ b/src/js/injectBaseStylesheet.js @@ -57,11 +57,10 @@ export default function injectBaseStylesheet() { const styleEl = document.createElement("style"); styleEl.type = "text/css"; - styleEl.classList = "drift-base-styles"; + styleEl.classList.add("drift-base-styles"); - styleEl.textContent = RULES; - const head = document.head; + styleEl.appendChild(document.createTextNode(RULES)); - const allHeadElements = head.getElementsByTagName("*"); - allHeadElements.innerHTML = styleEl + allHeadElements.innerHTML; + const head = document.head; + head.insertBefore(styleEl, head.firstChild); }