Bug 1404568 - Use the correct browser_action theme icons when the action is in a menu-panel. r=mixedpuppy draft
authorIan Moody <moz-ian@perix.co.uk>
Wed, 04 Oct 2017 01:40:45 +0100
changeset 676721 19808ff5921c2e9335b69f5bdc03aaac4f231b3c
parent 676720 3553cf4aec337f369a6e80efcb47addb169451f8
child 735037 6c10dedd992ad7e89a30ceed20712d84b961fb90
push id83604
push usermoz-ian@perix.co.uk
push dateMon, 09 Oct 2017 13:59:01 +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
@@ -366,22 +366,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);
   }
 
@@ -403,22 +402,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);
   }