mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[PCCompat] Rewrite plugin.loadStylesheet
This commit is contained in:
parent
eb9bfa949b
commit
27847ca0b6
2 changed files with 21 additions and 6 deletions
|
@ -5,12 +5,10 @@ export class Plugin {
|
|||
this.stylesheets = [];
|
||||
}
|
||||
|
||||
loadStylesheet(path) {
|
||||
const url = `https://raw.githubusercontent.com/${this.github.repo}/HEAD/${path}`; // HEAD essentially means default branch
|
||||
|
||||
loadStylesheet(css) {
|
||||
const el = document.createElement('style');
|
||||
|
||||
el.appendChild(document.createTextNode(`@import url(${url})`)); // Load the stylesheet via style element w/ CSS @import
|
||||
el.appendChild(document.createTextNode(css)); // Load the stylesheet via style element w/ CSS text
|
||||
|
||||
document.head.appendChild(el);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue