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",
34 "--tab-selected-bgcolor",
36 lwtProperty: "tab_selected",
40 "--tab-selected-textcolor",
42 lwtProperty: "tab_text",
46 "--lwt-tab-line-color",
48 lwtProperty: "tab_line",
49 optionalElementID: "TabsToolbar",
53 "--lwt-background-tab-separator-color",
55 lwtProperty: "tab_background_separator",
59 "--tabs-navbar-shadow-color",
61 lwtProperty: "toolbar_top_separator",
65 "--toolbarseparator-color",
67 lwtProperty: "toolbar_vertical_separator",
71 "--chrome-content-separator-color",
73 lwtProperty: "toolbar_bottom_separator",
77 "--toolbarbutton-icon-fill",
79 lwtProperty: "icon_color",
83 "--lwt-toolbarbutton-icon-fill-attention",
85 lwtProperty: "icon_attention_color",
89 "--toolbarbutton-hover-background",
91 lwtProperty: "button_background_hover",
95 "--toolbarbutton-active-background",
97 lwtProperty: "button_background_active",
101 "--urlbarView-highlight-background",
103 lwtProperty: "popup_highlight",
107 "--urlbarView-highlight-color",
109 lwtProperty: "popup_highlight_text",
113 "--sidebar-background-color",
115 lwtProperty: "sidebar",
116 processColor(rgbaChannels) {
120 const { r, g, b } = rgbaChannels;
121 // Drop alpha channel
122 return `rgb(${r}, ${g}, ${b})`;
127 "--sidebar-text-color",
129 lwtProperty: "sidebar_text",
133 "--sidebar-border-color",
135 lwtProperty: "sidebar_border",
139 "--tabpanel-background-color",
141 lwtProperty: "ntp_background",
142 processColor(rgbaChannels) {
145 !Services.prefs.getBoolPref("browser.newtabpage.enabled")
147 // We only set the tabpanel background to the new tab background color
148 // if the user uses about:home for new tabs. Otherwise, we flash a
149 // colorful background when a new tab is opened. We will flash the
150 // newtab color in new windows if the user uses about:home for new
151 // tabs but not new windows. However, the flash is concealed by the OS
152 // window-open animation.
155 // Drop alpha channel
156 let { r, g, b } = rgbaChannels;
157 return `rgb(${r}, ${g}, ${b})`;
163 export const ThemeContentPropertyList = [
165 "ntp_card_background",
169 "sidebar_highlight_text",