feat: Proper CSS api & css bundle (#269)

Co-authored-by: Vap0r1ze <superdash993@gmail.com>
This commit is contained in:
Ven 2022-12-25 20:47:35 +01:00 committed by GitHub
parent 2172cae779
commit 2e5d27b6b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 438 additions and 126 deletions

View file

@ -2,7 +2,18 @@ if (typeof browser === "undefined") {
var browser = chrome;
}
var script = document.createElement("script");
const script = document.createElement("script");
script.src = browser.runtime.getURL("dist/Vencord.js");
// documentElement because we load before body/head are ready
document.documentElement.appendChild(script);
const style = document.createElement("link");
style.type = "text/css";
style.rel = "stylesheet";
style.href = browser.runtime.getURL("dist/Vencord.css");
document.documentElement.append(script);
document.addEventListener(
"DOMContentLoaded",
() => document.documentElement.append(style),
{ once: true }
);