| 类型 |
对象
|
|---|---|
| Mandatory | No |
| 范例 |
|
This key enables the definition of experimental
theme
key properties for the Firefox interface. These experiments are a precursor to proposing new theme features for inclusion in Firefox. Experimentation is done by:
colors
,
图像
,和
properties
objects to new
theme
key properties.
colors
,
图像
,和
properties
to map internal Firefox CSS selectors, such as
--arrowpanel-dimmed
to new
theme
key properties. This option limits experimentation to UI components that are associated with an inbuilt CSS variable.
To discover the CSS selectors for Firefox UI elements or internal Firefox CSS variables use the browser toolbox .
注意:
This key is only available for use in Firefox Developer Edition and Firefox Nightly channels and requires the
extensions.experiments.enabled
preference to be enabled. In Firefox 73 and earlier, the
extensions.legacy.enabled
had to be used instead.
警告: This feature is experimental and could be subject to change.
The theme_experiment key is an object that takes the following properties:
| 名称 | 类型 | 描述 |
|---|---|---|
样式表
|
字符串
|
可选
Name of a stylesheet providing mapping of Firefox UI element CSS selectors to CSS variables. |
图像
|
对象
|
可选
Mappings of CSS variables (as defined in Firefox or by the stylesheet
defined in
|
colors
|
对象
|
可选
Mappings of CSS variables (as defined in Firefox or by the stylesheet
defined in
|
properties
|
对象
|
可选
Mappings of CSS variables (as defined in Firefox or by the stylesheet
defined in
|
This example uses a stylesheet named
style.css
to provide the ability to set a color for the browser reload button in the
theme
key.
The stylesheet defines:
#reload-button {
fill: var(--reload-button-color);
}
where
#reload-button
is the Firefox internal CSS selector for the reload button and
--reload-button-color
is an arbitrary name.
在
manifest.json
file,
--reload-button-color
is then mapped to the name to be used in the
theme
colors
特性:
"theme_experiment": {
"stylesheet": "style.css",
"colors": {
"reload_button": "--reload-button-color"
}
}
自变量
reload_button
is used in the same way as any other
theme
特性:
"theme": {
"colors": {
"reload_button": "orange"
}
}
This has the effect of making the reload icon orange.
This property can also be used in
browser.theme.update()
.
图像
and
properties
work in a similar way to
colors
.
BCD tables only load in the browser
最后修改: , 由 MDN 贡献者