Bug 1760051 - Port bug 1750932: Explicitly opt in dark and light themes to dark/light color-schemes. r=aleca
authorRichard Marti <richard.marti@gmail.com>
Thu, 17 Mar 2022 15:52:20 +0000
changeset 35212 ec2e89dea621828624c91fd35565f6b311baae9f
parent 35211 31042e4016bf1046bec9f6bd1941ade5fb93a665
child 35213 5287a833a2f520b438cb15c4a0b82333ad59872b
push id19748
push usergeoff@darktrojan.net
push dateThu, 17 Mar 2022 22:06:51 +0000
treeherdercomm-central@ec2e89dea621 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleca
bugs1760051, 1750932
Bug 1760051 - Port bug 1750932: Explicitly opt in dark and light themes to dark/light color-schemes. r=aleca Port of https://phabricator.services.mozilla.com/D136354 and https://phabricator.services.mozilla.com/D140365 Differential Revision: https://phabricator.services.mozilla.com/D141373
mail/components/extensions/parent/ext-theme.js
mail/components/extensions/schemas/theme.json
mail/themes/addons/dark/manifest.json
mail/themes/addons/light/manifest.json
--- a/mail/components/extensions/parent/ext-theme.js
+++ b/mail/components/extensions/parent/ext-theme.js
@@ -356,16 +356,21 @@ class Theme {
 
           let tiling = [];
           for (let i = 0, l = styles.additionalBackgrounds.length; i < l; ++i) {
             tiling.push(val[i] || "no-repeat");
           }
           styles.backgroundsTiling = tiling.join(",");
           break;
         }
+        case "color_scheme":
+        case "content_color_scheme": {
+          styles[property] = val;
+          break;
+        }
         default: {
           if (
             this.experiment &&
             this.experiment.properties &&
             property in this.experiment.properties
           ) {
             styles.experimental.properties[property] = val;
           } else {
--- a/mail/components/extensions/schemas/theme.json
+++ b/mail/components/extensions/schemas/theme.json
@@ -370,16 +370,36 @@
                     "no-repeat",
                     "repeat",
                     "repeat-x",
                     "repeat-y"
                   ]
                 },
                 "maxItems": 15,
                 "optional": true
+              },
+              "color_scheme": {
+                "description": "If set, overrides the general 'toolbar theme'.",
+                "optional": true,
+                "type": "string",
+                "enum": [
+                  "light",
+                  "dark",
+                  "auto"
+                ]
+              },
+              "content_color_scheme": {
+                "description": "If set, overrides the color scheme for the content area.",
+                "optional": true,
+                "type": "string",
+                "enum": [
+                  "light",
+                  "dark",
+                  "auto"
+                ]
               }
             },
             "additionalProperties": {
               "type": "string"
             }
           }
         },
         "additionalProperties": {
--- a/mail/themes/addons/dark/manifest.json
+++ b/mail/themes/addons/dark/manifest.json
@@ -41,16 +41,17 @@
       "button_hover": "rgb(82, 82, 94)",
       "button_active": "rgb(91, 91, 102)",
       "error_text_color": "rgb(255, 154, 162)",
       "input_background": "#42414d",
       "input_color": "#bfbfc9",
       "input_border": "#8f8f9d"
     },
     "properties": {
+      "color_scheme": "dark",
       "panel_hover": "color-mix(in srgb, currentColor 9%, transparent)",
       "panel_active": "color-mix(in srgb, currentColor 14%, transparent)",
       "panel_active_darker": "color-mix(in srgb, currentColor 25%, transparent)"
     }
   },
 
   "theme_experiment": {
     "stylesheet": "experiment.css",
--- a/mail/themes/addons/light/manifest.json
+++ b/mail/themes/addons/light/manifest.json
@@ -40,16 +40,17 @@
       "sidebar_highlight": "#2292d0",
       "sidebar_highlight_text": "#fff",
       "sidebar_highlight_border": "#0060df",
       "button": "rgba(207, 207, 216, 0.33)",
       "button_hover": "rgba(207, 207, 216, 0.66)",
       "button_active": "rgb(207, 207, 216)"
     },
     "properties": {
+      "color_scheme": "light",
       "panel_hover": "color-mix(in srgb, currentColor 12%, transparent)",
       "panel_active": "color-mix(in srgb, currentColor 20%, transparent)",
       "panel_active_darker": "color-mix(in srgb, currentColor 27%, transparent)"
     }
   },
 
   "theme_experiment": {
     "stylesheet": "experiment.css",