1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-09-11 19:32:24 +02:00

injectTheme fix

This commit is contained in:
GilbN 2021-10-07 23:09:57 +02:00
parent 67f4591cc5
commit 317da9022c

View File

@ -79,12 +79,13 @@ function injectTheme(theme,container="head") {
if (container === "head") {
html_element = document.head;
} else html_element = document.body;
let link = document.createElement("link");
let themeOption = document.getElementById("theme-option")
let link = themeOption ? themeOption : document.createElement("link");
url = "/CSS/variables/"
link.type = "text/css";
link.rel = "stylesheet";
link.href = `${url}/${theme.toLowerCase()}.css`;
link.id = `theme-option`
html_element.appendChild(link);
}