Closed sergejostir closed 3 years ago
You can use a before
callback to control when/where the CSS is placed:
loadjs("/path/to/file.css", {
before: function(path, el) {
// insertion logic goes here
document.head.appendChild(el);
// return `false` to bypass default DOM insertion mechanism
return false;
}
});
Hope that helps. Let me know if that works for you.
Ah, of course. Makes sense. Thanks
Hello.
Is it possible to specify before which element should css be put to? I'm thinking like "before" in https://github.com/filamentgroup/loadCSS
I would like to dynamically load a css file before already loaded one, but this library seems to always put new elements at the end of existing ones.