This commit is contained in:
1152958806@qq.com 2023-07-11 23:51:19 +08:00
parent 9bed18aab9
commit 3c1cf4e44f
1 changed files with 14 additions and 8 deletions

View File

@ -37,10 +37,13 @@ function coverColor() {
value = LightenDarkenColor(colorHex(value), -40)
}
document.styleSheets[0].addRule(':root', '--heo-main:' + value + '!important');
document.styleSheets[0].addRule(':root', '--heo-main-op:' + value + '23!important');
document.styleSheets[0].addRule(':root', '--heo-main-op-deep:' + value + 'dd!important');
document.styleSheets[0].addRule(':root', '--heo-main-none:' + value + '00!important');
const style = document.createElement('style');
document.head.appendChild(style);
const styleSheet = style.sheet;
styleSheet.insertRule(`:root{--heo-main: ${value}!important}`, styleSheet.cssRules.length);
styleSheet.insertRule(`:root{--heo-main-op: ${value}23!important}`, styleSheet.cssRules.length);
styleSheet.insertRule(`:root{--heo-main-op-deep: ${value}dd!important}`, styleSheet.cssRules.length);
styleSheet.insertRule(`:root{--heo-main-none: ${value}00!important}`, styleSheet.cssRules.length);
heo.initThemeColor()
document.getElementById("coverdiv").classList.add("loaded");
})
@ -50,10 +53,13 @@ function coverColor() {
} else {
// document.styleSheets[0].addRule('#page-header:before','background: none!important');
document.styleSheets[0].addRule(':root', '--heo-main: var(--heo-theme)!important');
document.styleSheets[0].addRule(':root', '--heo-main-op: var(--heo-theme-op)!important');
document.styleSheets[0].addRule(':root', '--heo-main-op-deep:var(--heo-theme-op-deep)!important');
document.styleSheets[0].addRule(':root', '--heo-main-none: var(--heo-theme-none)!important');
const style = document.createElement('style');
document.head.appendChild(style);
const styleSheet = style.sheet;
styleSheet.insertRule(`:root{--heo-main: var(--heo-theme)!important}`, styleSheet.cssRules.length);
styleSheet.insertRule(`:root{--heo-main-op: var(--heo-theme-op)!important}`, styleSheet.cssRules.length);
styleSheet.insertRule(`:root{--heo-main-op-deep:var(--heo-theme-op-deep)!important}`, styleSheet.cssRules.length);
styleSheet.insertRule(`:root{--heo-main-none: var(--heo-theme-none)!important}`, styleSheet.cssRules.length);
heo.initThemeColor()
}
}