@patternslib/dev
Version:
Development base files for working with Patternslib and add-ons.
13 lines (11 loc) • 363 B
JavaScript
function style_inserter(el) {
// Insert element at the top of <head>
// Used for injecting CSS via webpack before any other CSS
var first_child = document.head.querySelectorAll("*")[0];
if (first_child) {
document.head.insertBefore(el, first_child);
} else {
document.head.append(el);
}
}
module.exports = style_inserter;