Bug 1462635 - Fix disabled text color in webext theme styled popups. r=ntim
MozReview-Commit-ID: myI1PNipvK
This commit is contained in:
@@ -77,28 +77,7 @@ const ThemeVariableMap = [
|
||||
lwtProperty: "popup"
|
||||
}],
|
||||
["--autocomplete-popup-color", {
|
||||
lwtProperty: "popup_text",
|
||||
processColor(rgbaChannels, element) {
|
||||
const secondaryVariable = "--autocomplete-popup-secondary-color";
|
||||
|
||||
if (!rgbaChannels) {
|
||||
element.removeAttribute("lwt-popup-brighttext");
|
||||
element.style.removeProperty(secondaryVariable);
|
||||
return null;
|
||||
}
|
||||
|
||||
let {r, g, b, a} = rgbaChannels;
|
||||
let luminance = 0.2125 * r + 0.7154 * g + 0.0721 * b;
|
||||
|
||||
if (luminance <= 110) {
|
||||
element.removeAttribute("lwt-popup-brighttext");
|
||||
} else {
|
||||
element.setAttribute("lwt-popup-brighttext", "true");
|
||||
}
|
||||
|
||||
element.style.setProperty(secondaryVariable, `rgba(${r}, ${g}, ${b}, 0.5)`);
|
||||
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
||||
}
|
||||
lwtProperty: "popup_text"
|
||||
}],
|
||||
["--autocomplete-popup-border-color", {
|
||||
lwtProperty: "popup_border"
|
||||
|
||||
Reference in New Issue
Block a user