fix: optimize contrast color compute

This commit is contained in:
Jérôme Wiedemann 2023-07-24 01:45:12 +00:00
parent 9f21c58dac
commit 35109c3d5c
1 changed files with 0 additions and 13 deletions

View File

@ -31,19 +31,6 @@ export function getColorFromVariable(elt: Element, color: string): string {
result = card;
return true;
}
const root = window.getComputedStyle(document.documentElement).getPropertyValue(color);
if (root) {
result = root;
return true;
}
const customStyles = document.documentElement.getElementsByTagName('custom-style');
for (const element of customStyles) {
const value = window.getComputedStyle(element).getPropertyValue(color);
if (value) {
result = value;
return true;
}
}
return false;
});
}