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:
parent
67f4591cc5
commit
317da9022c
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user