fix accent generate btn

pull/178/head
Nevysha 2023-07-07 21:03:22 +02:00
parent 68660059cc
commit 774df88420
3 changed files with 56 additions and 55 deletions

File diff suppressed because one or more lines are too long

View File

@ -508,7 +508,7 @@ input[type=range]::-webkit-slider-thumb {
border-radius: 0;
overflow-y: auto;
height: var(--main-container-height);
padding: 0 10px;
padding: 0 10px !important;
}
#tabs > .nevysha.tabitem::-webkit-scrollbar {
width: 5px;
@ -1985,4 +1985,9 @@ button#interrogate {
#script_list {
padding: 5px !important;
}
.nevysha.generate-button.accent {
background: var(--ae-primary-color) !important;
color: var(--nevysha-color-from-luminance) !important;
}

View File

@ -82,13 +82,9 @@ export const applyAccentForGenerate = (checked, hexColorForAccent) => {
COZY_NEST_CONFIG.accent_generate_button = checked;
document.querySelectorAll('button[id$="_generate"]').forEach((btn) => {
if (checked) {
let txtColorAppending = "";
if (getLuminance(hexColorForAccent) > 0.5) {
txtColorAppending = "color: black !important";
}
btn.setAttribute("style", `background: var(--ae-primary-color) !important; ${txtColorAppending}`);
btn.classList.add("accent")
} else {
btn.setAttribute("style", '');
btn.classList.remove("accent")
}
})
}