summaryrefslogtreecommitdiffstats
path: root/comm/mail/components/extensions/schemas/theme.json
blob: cba8abd780d8f375fa72afcc3a4735c107d224d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
[
  {
    "namespace": "manifest",
    "types": [
      {
        "$extend": "PermissionNoPrompt",
        "choices": [
          {
            "type": "string",
            "enum": ["theme"]
          }
        ]
      },
      {
        "id": "ThemeColor",
        "description": "Defines a color value.",
        "choices": [
          {
            "type": "string",
            "description": "A string containing a valid `CSS color string <|link-css-color-string|>`__, including hexadecimal or functional representations. For example the color *crimson* can be specified as: <li><value>crimson</value> <li><value>#dc143c</value> <li><value>rgb(220, 20, 60)</value> (or <value>rgba(220, 20, 60, 0.5)</value> to set 50% opacity) <li><value>hsl(348, 83%, 47%)</value> (or <value>hsla(348, 83%, 47%, 0.5)</value> to set 50% opacity)"
          },
          {
            "type": "array",
            "description": "An RGB array of 3 integers. For example <value>[220, 20, 60]</value> for the color *crimson*.",
            "minItems": 3,
            "maxItems": 3,
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 255
            }
          },
          {
            "type": "array",
            "description": "An RGBA array of 3 integers and a fractional (a float between 0 and 1). For example <value>[220, 20, 60, 0.5]<value> for the color *crimson* with 50% opacity.",
            "minItems": 4,
            "maxItems": 4,
            "items": {
              "type": "number"
            }
          }
        ]
      },
      {
        "id": "ThemeExperiment",
        "description": "Defines additional color, image and property keys to be used in :ref:`theme.ThemeType`, extending the theme-able areas of Thunderbird.",
        "type": "object",
        "properties": {
          "stylesheet": {
            "optional": true,
            "description": "URL to a stylesheet introducing additional CSS variables, extending the theme-able areas of Thunderbird. The `theme_experiment add-on in our example repository <https://github.com/thunderbird/sample-extensions/tree/master/theme_experiment>`__ is using the stylesheet shown below, to add the <value>--chat-button-color</value> CSS color variable: <literalinclude>includes/theme/theme_experiment_style.css<lang>CSS</lang></literalinclude>The following <em>manifest.json</em> file maps the </value>--chat-button-color</value> CSS color variable to the theme color key <value>exp_chat_button</value> and uses it to set a color for the chat button: <literalinclude>includes/theme/theme_experiment_manifest.json<lang>JSON</lang></literalinclude>",
            "$ref": "ExtensionURL"
          },
          "images": {
            "type": "object",
            "optional": true,
            "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map new theme image keys to internal Thunderbird CSS image variables. The new image key is usable as an image reference in :ref:`theme.ThemeType`. Example: <literalinclude>includes/theme/theme_experiment_image.json<lang>JSON</lang></literalinclude>",
            "additionalProperties": {
              "type": "string"
            }
          },
          "colors": {
            "type": "object",
            "optional": true,
            "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map new theme color keys to internal Thunderbird CSS color variables. The example shown below maps the theme color key <value>popup_affordance</value> to the CSS color variable </value>--arrowpanel-dimmed</value>. The new color key is usable as a color reference in :ref:`theme.ThemeType`. <literalinclude>includes/theme/theme_experiment_color.json<lang>JSON</lang></literalinclude>",
            "additionalProperties": {
              "type": "string"
            }
          },
          "properties": {
            "type": "object",
            "optional": true,
            "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map new theme property keys to internal Thunderbird CSS property variables. The new property key is usable as a property reference in :ref:`theme.ThemeType`. Example: <literalinclude>includes/theme/theme_experiment_property.json<lang>JSON</lang></literalinclude>",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      {
        "id": "ThemeType",
        "description": "Contains the color, image and property settings of a theme.",
        "type": "object",
        "properties": {
          "images": {
            "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map images to theme image keys. The following built-in theme image keys are supported:",
            "type": "object",
            "optional": true,
            "properties": {
              "additional_backgrounds": {
                "type": "array",
                "items": {
                  "$ref": "ImageDataOrExtensionURL"
                },
                "maxItems": 15,
                "optional": true,
                "description": "Additional images added to the header area and displayed behind the ``theme_frame`` image."
              },
              "headerURL": {
                "$ref": "ImageDataOrExtensionURL",
                "optional": true,
                "deprecated": "Unsupported images property, use ``theme.images.theme_frame``, this alias is ignored in Thunderbird >= 70."
              },
              "theme_frame": {
                "$ref": "ImageDataOrExtensionURL",
                "optional": true,
                "description": "Foreground image on the header area."
              }
            },
            "additionalProperties": {
              "$ref": "ImageDataOrExtensionURL"
            }
          },
          "colors": {
            "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map color values to theme color keys. The following built-in theme color keys are supported:",
            "type": "object",
            "optional": true,
            "properties": {
              "tab_selected": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "Background color of the selected tab. Defaults to the color specified by ``toolbar``."
              },
              "accentcolor": {
                "$ref": "ThemeColor",
                "optional": true,
                "deprecated": "Unsupported colors property, use ``theme.colors.frame``, this alias is ignored in Thunderbird >= 70."
              },
              "frame": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color of the header area."
              },
              "frame_inactive": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color of the header area when the window is inactive."
              },
              "textcolor": {
                "$ref": "ThemeColor",
                "optional": true,
                "deprecated": "Unsupported color property, use ``theme.colors.tab_background_text``, this alias is ignored in Thunderbird >= 70."
              },
              "tab_background_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color of the unselected tabs."
              },
              "tab_background_separator": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the vertical separator of the background tabs."
              },
              "tab_loading": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the tab loading indicator."
              },
              "tab_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color for the selected tab. Defaults to the color specified by ``toolbar_text``."
              },
              "tab_line": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the selected tab line."
              },
              "toolbar": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color of the toolbars. Also used as default value for ``tab_selected``."
              },
              "toolbar_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color in the main Thunderbird toolbar. Also used as default value for ``icons`` and ``tab_text``."
              },
              "bookmark_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "Not used in Thunderbird."
              },
              "toolbar_field": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color for fields in the toolbar, such as the search field."
              },
              "toolbar_field_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color for fields in the toolbar."
              },
              "toolbar_field_border": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The border color for fields in the toolbar."
              },
              "toolbar_field_separator": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "Not used in Thunderbird.",
                "deprecated": "This color property is ignored in >= 89."
              },
              "toolbar_top_separator": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the line separating the top of the toolbar from the region above."
              },
              "toolbar_bottom_separator": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the line separating the bottom of the toolbar from the region below."
              },
              "toolbar_vertical_separator": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the vertical separators on the toolbars."
              },
              "icons": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the toolbar icons. Defaults to the color specified by ``toolbar_text``."
              },
              "icons_attention": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the toolbar icons in attention state such as the chat icon with new messages."
              },
              "button_background_hover": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the background of the toolbar buttons on hover."
              },
              "button_background_active": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color of the background of the pressed toolbar buttons."
              },
              "popup": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color of popups such as the AppMenu."
              },
              "popup_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color of popups."
              },
              "popup_border": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The border color of popups."
              },
              "toolbar_field_focus": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The focused background color for fields in the toolbar."
              },
              "toolbar_field_text_focus": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color in the focused fields in the toolbar."
              },
              "toolbar_field_border_focus": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The focused border color for fields in the toolbar."
              },
              "popup_highlight": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color of items highlighted using the keyboard inside popups."
              },
              "popup_highlight_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color of items highlighted using the keyboard inside popups."
              },
              "ntp_background": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "Not used in Thunderbird."
              },
              "ntp_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "Not used in Thunderbird."
              },
              "sidebar": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color of the trees."
              },
              "sidebar_border": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The border color of the trees."
              },
              "sidebar_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color of the trees. Needed to enable the tree theming."
              },
              "sidebar_highlight": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color of highlighted rows in trees."
              },
              "sidebar_highlight_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The text color of highlighted rows in trees."
              },
              "sidebar_highlight_border": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The border color of highlighted rows in trees."
              },
              "toolbar_field_highlight": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The background color used to indicate the current selection of text in the search field."
              },
              "toolbar_field_highlight_text": {
                "$ref": "ThemeColor",
                "optional": true,
                "description": "The color used to draw text that's currently selected in the search field."
              }
            },
            "additionalProperties": {
              "$ref": "ThemeColor"
            }
          },
          "properties": {
            "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map property values to theme property keys. The following built-in theme property keys are supported:",
            "type": "object",
            "optional": true,
            "properties": {
              "additional_backgrounds_alignment": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "bottom",
                    "center",
                    "left",
                    "right",
                    "top",
                    "center bottom",
                    "center center",
                    "center top",
                    "left bottom",
                    "left center",
                    "left top",
                    "right bottom",
                    "right center",
                    "right top"
                  ]
                },
                "maxItems": 15,
                "optional": true
              },
              "additional_backgrounds_tiling": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": ["no-repeat", "repeat", "repeat-x", "repeat-y"]
                },
                "maxItems": 15,
                "optional": true
              },
              "color_scheme": {
                "description": "If set, overrides the general theme (context menus, toolbars, content area).",
                "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": {
          "$ref": "UnrecognizedProperty"
        }
      },
      {
        "id": "ThemeManifest",
        "type": "object",
        "description": "Contents of manifest.json for a static theme",
        "$import": "manifest.ManifestBase",
        "properties": {
          "theme": {
            "$ref": "ThemeType"
          },
          "dark_theme": {
            "$ref": "ThemeType",
            "optional": true,
            "description": "Fallback properties for the dark system theme."
          },
          "default_locale": {
            "type": "string",
            "optional": true
          },
          "theme_experiment": {
            "$ref": "ThemeExperiment",
            "optional": true,
            "description": "CSS file with additional styles."
          },
          "icons": {
            "type": "object",
            "optional": true,
            "patternProperties": {
              "^[1-9]\\d*$": {
                "type": "string"
              }
            },
            "description": "Icons shown in the Add-ons Manager."
          }
        }
      },
      {
        "$extend": "WebExtensionManifest",
        "properties": {
          "theme_experiment": {
            "$ref": "ThemeExperiment",
            "optional": true,
            "description": "A theme experiment allows modifying the user interface of Thunderbird beyond what is currently possible using the built-in color, image and property keys of :ref:`theme.ThemeType`. These experiments are a precursor to proposing new theme features for inclusion in Thunderbird. Experimentation is done by mapping internal CSS color, image and property variables to new theme keys and using them in :ref:`theme.ThemeType` and by loading additional style sheets to add new CSS variables, extending the theme-able areas of Thunderbird. Can be used in static and dynamic themes."
          }
        }
      }
    ]
  },
  {
    "namespace": "theme",
    "description": "The theme API allows for customization of Thunderbird's visual elements.",
    "types": [
      {
        "id": "ThemeUpdateInfo",
        "type": "object",
        "description": "Info provided in the onUpdated listener.",
        "properties": {
          "theme": {
            "$ref": "ThemeType",
            "description": "The new theme after update"
          },
          "windowId": {
            "type": "integer",
            "description": "The id of the window the theme has been applied to",
            "optional": true
          }
        }
      }
    ],
    "events": [
      {
        "name": "onUpdated",
        "type": "function",
        "description": "Fired when a new theme has been applied",
        "parameters": [
          {
            "$ref": "ThemeUpdateInfo",
            "name": "updateInfo",
            "description": "Details of the theme update"
          }
        ]
      }
    ],
    "functions": [
      {
        "name": "getCurrent",
        "type": "function",
        "async": "callback",
        "description": "Returns the current theme for the specified window or the last focused window.",
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "optional": true,
            "description": "The window for which we want the theme."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "ThemeType"
              }
            ]
          }
        ]
      },
      {
        "name": "update",
        "type": "function",
        "async": true,
        "description": "Make complete updates to the theme. Resolves when the update has completed.",
        "permissions": ["theme"],
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "optional": true,
            "description": "The id of the window to update. No id updates all windows."
          },
          {
            "name": "details",
            "$ref": "manifest.ThemeType",
            "description": "The properties of the theme to update."
          }
        ]
      },
      {
        "name": "reset",
        "type": "function",
        "async": true,
        "description": "Removes the updates made to the theme.",
        "permissions": ["theme"],
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "optional": true,
            "description": "The id of the window to reset. No id resets all windows."
          }
        ]
      }
    ]
  }
]