1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 export const ThemeVariableMap = [
7 "--lwt-accent-color-inactive",
9 lwtProperty: "accentcolorInactive",
13 "--lwt-background-alignment",
16 lwtProperty: "backgroundsAlignment",
20 "--lwt-background-tiling",
23 lwtProperty: "backgroundsTiling",
29 lwtProperty: "tab_loading",
30 optionalElementID: "tabbrowser-tabs",
36 lwtProperty: "tab_text",
40 "--lwt-tab-line-color",
42 lwtProperty: "tab_line",
43 optionalElementID: "TabsToolbar",
47 "--lwt-background-tab-separator-color",
49 lwtProperty: "tab_background_separator",
55 lwtProperty: "toolbarColor",
61 lwtProperty: "toolbar_text",
65 "--lwt-tabs-border-color",
67 lwtProperty: "toolbar_top_separator",
68 optionalElementID: "navigator-toolbox",
72 "--toolbarseparator-color",
74 lwtProperty: "toolbar_vertical_separator",
78 "--chrome-content-separator-color",
80 lwtProperty: "toolbar_bottom_separator",
84 "--toolbarbutton-icon-fill",
86 lwtProperty: "icon_color",
90 "--lwt-toolbarbutton-icon-fill-attention",
92 lwtProperty: "icon_attention_color",
96 "--toolbarbutton-hover-background",
98 lwtProperty: "button_background_hover",
102 "--toolbarbutton-active-background",
104 lwtProperty: "button_background_active",
108 "--lwt-selected-tab-background-color",
110 lwtProperty: "tab_selected",
114 "--autocomplete-popup-highlight-background",
116 lwtProperty: "popup_highlight",
120 "--autocomplete-popup-highlight-color",
122 lwtProperty: "popup_highlight_text",
126 "--sidebar-background-color",
128 lwtProperty: "sidebar",
129 optionalElementID: "sidebar-box",
130 processColor(rgbaChannels, element) {
132 element.removeAttribute("lwt-sidebar");
135 const { r, g, b } = rgbaChannels;
136 element.setAttribute("lwt-sidebar", "true");
137 // Drop alpha channel
138 return `rgb(${r}, ${g}, ${b})`;
143 "--sidebar-text-color",
145 lwtProperty: "sidebar_text",
146 optionalElementID: "sidebar-box",
150 "--sidebar-border-color",
152 lwtProperty: "sidebar_border",
153 optionalElementID: "browser",
157 "--tabpanel-background-color",
159 lwtProperty: "ntp_background",
160 processColor(rgbaChannels) {
163 !Services.prefs.getBoolPref("browser.newtabpage.enabled")
165 // We only set the tabpanel background to the new tab background color
166 // if the user uses about:home for new tabs. Otherwise, we flash a
167 // colorful background when a new tab is opened. We will flash the
168 // newtab color in new windows if the user uses about:home for new
169 // tabs but not new windows. However, the flash is concealed by the OS
170 // window-open animation.
173 // Drop alpha channel
174 let { r, g, b } = rgbaChannels;
175 return `rgb(${r}, ${g}, ${b})`;
181 export const ThemeContentPropertyList = [
183 "ntp_card_background",
187 "sidebar_highlight_text",