Bug 1502722 - Port bug 1501586 to TB: Clean up lwt-*-brighttext attributes properly when switching from a dark theme to a light theme. r+a=jorgk
authorRichard Marti <richard.marti@gmail.com>
Sun, 28 Oct 2018 11:57:08 +0100
changeset 33469 640700d9f20631e173950af15b7efbc7ef3d427d
parent 33468 6ee1e1ef041d15c166330eb8cbe71115dde72100
child 33470 3e08c32a7ddb2652481f584f82c275247531cb35
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
bugs1502722, 1501586
Bug 1502722 - Port bug 1501586 to TB: Clean up lwt-*-brighttext attributes properly when switching from a dark theme to a light theme. r+a=jorgk
mail/base/modules/ThemeVariableMap.jsm
--- a/mail/base/modules/ThemeVariableMap.jsm
+++ b/mail/base/modules/ThemeVariableMap.jsm
@@ -91,16 +91,18 @@ const ThemeVariableMap = [
         element.removeAttribute("lwt-tree-brighttext");
         return null;
       }
 
       element.setAttribute("lwt-tree", "true");
       const {r, g, b, a} = rgbaChannels;
       if (!_isTextColorDark(r, g, b)) {
         element.setAttribute("lwt-tree-brighttext", "true");
+      } else {
+        element.removeAttribute("lwt-tree-brighttext");
       }
 
       return `rgba(${r}, ${g}, ${b}, ${a})`;
     },
   }],
   ["--sidebar-highlight-background-color", {
     lwtProperty: "sidebar_highlight",
   }],