mirror of
https://github.com/Equicord/Equicord.git
synced 2025-03-14 14:10:26 -04:00
injectcss if glide is enabled
This commit is contained in:
parent
70f5dba456
commit
0a0d817d1e
1 changed files with 12 additions and 10 deletions
|
@ -243,18 +243,20 @@ function parseFontContent() {
|
||||||
return fontName;
|
return fontName;
|
||||||
}
|
}
|
||||||
function injectCSS() {
|
function injectCSS() {
|
||||||
|
if (Settings.plugins.Glide.enabled) {
|
||||||
|
|
||||||
const fontName = parseFontContent();
|
const fontName = parseFontContent();
|
||||||
const theCSS = getCSS(fontName);
|
const theCSS = getCSS(fontName);
|
||||||
|
|
||||||
var elementToRemove = document.getElementById("GlideStyleInjection");
|
let elementToRemove = document.getElementById("GlideStyleInjection");
|
||||||
if (elementToRemove) {
|
if (elementToRemove) {
|
||||||
elementToRemove.remove();
|
elementToRemove.remove();
|
||||||
|
}
|
||||||
|
const styleElement = document.createElement("style");
|
||||||
|
styleElement.id = "GlideStyleInjection";
|
||||||
|
styleElement.textContent = theCSS;
|
||||||
|
document.documentElement.appendChild(styleElement);
|
||||||
}
|
}
|
||||||
const styleElement = document.createElement("style");
|
|
||||||
styleElement.id = "GlideStyleInjection";
|
|
||||||
styleElement.textContent = theCSS;
|
|
||||||
document.documentElement.appendChild(styleElement);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCSS(fontName) {
|
function getCSS(fontName) {
|
||||||
|
@ -528,7 +530,7 @@ function getCSS(fontName) {
|
||||||
background-color: var(--primary);
|
background-color: var(--primary);
|
||||||
}
|
}
|
||||||
${settings.store.pastelStatuses ?
|
${settings.store.pastelStatuses ?
|
||||||
`
|
`
|
||||||
/*Pastel statuses*/
|
/*Pastel statuses*/
|
||||||
rect[fill='#23a55a'], svg[fill='#23a55a'] {
|
rect[fill='#23a55a'], svg[fill='#23a55a'] {
|
||||||
fill: #80c968 !important;
|
fill: #80c968 !important;
|
||||||
|
|
Loading…
Add table
Reference in a new issue