Bug 1404568 - Use the correct browser_action theme icons when the action is in a menu-panel. r=mixedpuppy
authorIan Moody <moz-ian@perix.co.uk>
Wed, 04 Oct 2017 01:40:45 +0100
changeset 427812 38347dff77997359905b6efc1f6061e4103431d6
parent 427811 ca81275884eb6147bd1022779fcac81fa0930128
child 427813 2d91a88f5f5d09e0d714c68ddb76ff24479056be
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersmixedpuppy
bugs1404568
milestone58.0a1
Bug 1404568 - Use the correct browser_action theme icons when the action is in a menu-panel. r=mixedpuppy The patch adding support for specifying theme icons had a bug in the CSS: it added styles for the action in a menu-panel depending on theme, but missed out the theme pseudo-class selectors. Therefore the dark text icon was always used since it was last in the CSS. Additionally, the menu panels can't be styled, so still have light backgrounds and dark text even in light text themes. If a light icon is used in the menu panel in a light text theme it will be hard to see. Thus, this patch adds the pseudo-class for dark text themes, but removes the selector entirely for light text themes. MozReview-Commit-ID: AmKVDYwGGKj
browser/base/content/browser.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -368,22 +368,21 @@ toolbarpaletteitem > toolbaritem[sdkstyl
     list-style-image: var(--webextension-toolbar-image-dark, inherit);
   }
 
   .webextension-browser-action[cui-areatype="menu-panel"],
   toolbarpaletteitem[place="palette"] > .webextension-browser-action {
     list-style-image: var(--webextension-menupanel-image, inherit);
   }
 
-  .webextension-browser-action[cui-areatype="menu-panel"],
   toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-brighttext {
     list-style-image: var(--webextension-menupanel-image-light, inherit);
   }
 
-  .webextension-browser-action[cui-areatype="menu-panel"],
+  .webextension-browser-action[cui-areatype="menu-panel"]:-moz-lwtheme-darktext,
   toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-darktext {
     list-style-image: var(--webextension-menupanel-image-dark, inherit);
   }
 
   .webextension-page-action {
     list-style-image: var(--webextension-urlbar-image, inherit);
   }
 
@@ -405,22 +404,21 @@ toolbarpaletteitem > toolbaritem[sdkstyl
     list-style-image: var(--webextension-toolbar-image-2x-dark, inherit);
   }
 
   .webextension-browser-action[cui-areatype="menu-panel"],
   toolbarpaletteitem[place="palette"] > .webextension-browser-action {
     list-style-image: var(--webextension-menupanel-image-2x, inherit);
   }
 
-  .webextension-browser-action[cui-areatype="menu-panel"],
   toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-brighttext {
     list-style-image: var(--webextension-menupanel-image-2x-light, inherit);
   }
 
-  .webextension-browser-action[cui-areatype="menu-panel"],
+  .webextension-browser-action[cui-areatype="menu-panel"]:-moz-lwtheme-darktext,
   toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-darktext {
     list-style-image: var(--webextension-menupanel-image-2x-dark, inherit);
   }
 
   .webextension-page-action {
     list-style-image: var(--webextension-urlbar-image-2x, inherit);
   }