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/. */
7 --dot-position: calc
(var
(--icon-size
) / 2 + var
(--arrowpanel-menuitem-margin-inline
) + var
(--arrowpanel-menuitem-padding-inline
) - 4px);
8 /* uei = unified extensions item */
9 --uei-button-hover-bgcolor: var
(--panel-item-hover-bgcolor
);
10 --uei-button-hover-color: inherit
;
11 --uei-button-active-bgcolor: var
(--panel-item-active-bgcolor
);
12 --uei-button-active-color: inherit
;
15 :root
[uidensity
="compact"] {
19 unified-extensions-item
{
24 unified-extensions-item
,
25 .unified-extensions-item {
29 /* This is based on the attention UI defined in:
30 * https://searchfox.org/mozilla-central/rev/560b7b1b17/browser/themes/shared/tabs.css#624 */
31 #unified-extensions-button[attention
],
32 .unified-extensions-item
[attention
],
33 unified-extensions-item
[attention
] {
34 background-image: radial-gradient
(circle
, var
(--tab-attention-icon-color
), var
(--tab-attention-icon-color
) 2px, transparent
2px);
35 background-position: center bottom max
(0px, calc
(var
(--arrowpanel-menuitem-padding-block
) - 4px));
36 background-size: 8px 8px;
37 background-repeat: no-repeat
;
40 unified-extensions-item
[attention
] {
41 background-position: left var
(--dot-position
) bottom
0px;
44 unified-extensions-item
[attention
]:-moz-locale-dir
(rtl
) {
45 background-position-x: right var
(--dot-position
);
48 .unified-extensions-item-action {
50 background-color: transparent
;
53 /* The padding-block for menuitems is set to 0 in compact mode which, with the
54 * extension icon being 32px in this case, makes the item look crowded even for
56 :root
[uidensity
="compact"] panel:not
([touchmode
]) .unified-extensions-item-action
{
60 .unified-extensions-item-action[disabled].subviewbutton {
61 color: var
(--panel-description-color
);
64 .unified-extensions-item-action[disabled] .unified-extensions-item-icon {
69 unified-extensions-item
[secondary-button-hovered
="true"],
70 .unified-extensions-item
[secondary-button-hovered
="true"]
71 ) .unified-extensions-item-action
.subviewbutton
{
75 .unified-extensions-item-icon
,
76 /* When the unified extensions pref is enabled, we also want to increase the
77 * size of the icons in the extension CUI widgets. */
78 panel
.unified-extensions-item
[unified-extensions
="true"] .webextension-browser-action
> .toolbarbutton-badge-stack
> .toolbarbutton-icon
{
79 height: var
(--icon-size
);
80 width: var
(--icon-size
);
81 margin-inline-end: 6px;
84 .unified-extensions-item-icon
,
85 .unified-extensions-item-contents {
89 .unified-extensions-item-name
,
90 .unified-extensions-item-message {
92 padding-inline-start: .5em;
94 word-break: break-word
;
97 .unified-extensions-item-message {
98 color: var
(--panel-description-color
);
101 unified-extensions-item
[secondary-button-hovered
="true"] .unified-extensions-item-message:not
(.unified-extensions-item-message-hover
),
102 unified-extensions-item:not
([secondary-button-hovered
="true"]) .unified-extensions-item-message-hover
,
103 /* The two selectors below are for CUI widgets. */
104 .unified-extensions-item
[secondary-button-hovered
="true"] .unified-extensions-item-message:not
(.unified-extensions-item-message-hover
),
105 .unified-extensions-item:not([secondary-button-hovered="true"]) .unified-extensions-item-message-hover {
109 .unified-extensions-item-open-menu.subviewbutton {
110 list-style-image: url
("chrome://global/skin/icons/settings.svg");
112 margin-inline-end: var
(--arrowpanel-menuitem-margin-inline
);
113 /* Have the icon even padding all around by default */
114 padding: var
(--arrowpanel-menuitem-padding-inline
);
115 border: 1px solid transparent
;
116 background-color: transparent
;
119 .unified-extensions-item-open-menu.subviewbutton > .toolbarbutton-text {
123 /* --- browser action CUI widget styles --- */
125 /* Hide secondary (menu) button when the widget is in the list of widgets in
126 * customization mode. */
127 toolbaritem
.unified-extensions-item:not
([cui-areatype
="panel"], [overflowedItem
=true
]) .unified-extensions-item-open-menu
{
131 /* Hide subviewbutton label by default, it should only be shown in the old
132 * overflow panel and the palette. */
133 toolbaritem
.unified-extensions-item
[cui-areatype
="toolbar"] .toolbarbutton-text
,
134 #unified-extensions-area > toolbaritem
.unified-extensions-item
.toolbarbutton-text
{
138 /* Hide unified extensions content by default, unless the item is overflowed or in
139 * a panel. Also hide this content if the item is visible in customize mode. */
140 toolbaritem
.unified-extensions-item:not
([overflowedItem
="true"], [cui-areatype
="panel"]) .unified-extensions-item-contents
,
141 toolbarpaletteitem
> toolbaritem
.unified-extensions-item
.unified-extensions-item-contents
{
145 toolbaritem
.unified-extensions-item
.unified-extensions-item-open-menu
.subviewbutton
{
147 margin-inline-start: var
(--arrowpanel-menuitem-margin-inline
);
148 padding: var
(--arrowpanel-menuitem-padding
);
149 border: 1px solid transparent
;
152 /* When the unified extensions pref is set, we want to always have a "large"
153 * menu button, even on compact mode since each extension has two lines of text
154 * anyway (extension name and message). */
155 toolbaritem
.unified-extensions-item
[unified-extensions
="true"] .unified-extensions-item-open-menu
.subviewbutton
{
159 /* --- browser action CUI widget styles in the overflow/unified extensions panel --- */
161 /* Align CUI widgets with the custom elements in the unified extensions panel. */
162 #unified-extensions-panel toolbaritem
.unified-extensions-item
{
163 max-width: max-content
;
166 /* Show CUI widget label in overflow panel when the unified extensions pref is
168 .widget-overflow-list toolbaritem.unified-extensions-item[unified-extensions="false"] .unified-extensions-item-action .toolbarbutton-text {
173 .widget-overflow-list
.unified-extensions-item
[attention
],
174 #unified-extensions-panel .unified-extensions-item
[attention
] {
175 background-position: left calc
(12px + var
(--arrowpanel-menuitem-margin-inline
)) bottom
;
178 .widget-overflow-list
.unified-extensions-item
[attention
]:-moz-locale-dir
(rtl
),
179 #unified-extensions-panel .unified-extensions-item
[attention
]:-moz-locale-dir
(rtl
) {
180 background-position-x: right calc
(12px + var
(--arrowpanel-menuitem-margin-inline
));
183 .widget-overflow-list .unified-extensions-item[attention][unified-extensions="false"] {
184 background-position-x: left
12px;
187 .widget-overflow-list .unified-extensions-item[attention][unified-extensions="false"]:-moz-locale-dir(rtl) {
188 background-position-x: right
12px;
191 @media (prefers-contrast
) {
192 .unified-extensions-item
[attention
],
193 unified-extensions-item
[attention
] {
194 background-image: radial-gradient
(circle
, ButtonText
, ButtonText
2px, transparent
2px);
197 .unified-extensions-item-action:not
([disabled
]).subviewbutton
,
198 .unified-extensions-item-open-menu
.subviewbutton
,
199 toolbaritem
.unified-extensions-item
.unified-extensions-action:not
([disabled
]).subviewbutton
,
200 toolbaritem
.unified-extensions-item
.unified-extensions-item-open-menu
.subviewbutton
{
201 border-color: currentColor
;
202 background-color: ButtonFace
;
204 --uei-button-hover-bgcolor: SelectedItem
;
205 --uei-button-hover-color: SelectedItemText
;
206 --uei-button-active-bgcolor: ButtonFace
;
207 --uei-button-active-color: ButtonText
;
210 .unified-extensions-item-action[disabled].subviewbutton {
211 background-color: Canvas
;
215 .unified-extensions-item-action
[disabled
] .unified-extensions-item-message
,
216 unified-extensions-item
[secondary-button-hovered
="true"] .unified-extensions-item-action
[disabled
].subviewbutton
,
217 .unified-extensions-item[secondary-button-hovered="true"] .unified-extensions-item-action[disabled].subviewbutton {
221 .unified-extensions-item-action:not([disabled]) .unified-extensions-item-message {
225 .unified-extensions-item-action:not([disabled]):hover .unified-extensions-item-message {
231 .unified-extensions-item-action:not
([disabled
]).subviewbutton
,
232 .unified-extensions-item-open-menu
.subviewbutton
,
233 toolbaritem
.unified-extensions-item
.unified-extensions-action:not
([disabled
]).subviewbutton
,
234 toolbaritem
.unified-extensions-item
.unified-extensions-item-open-menu
.subviewbutton
235 ):hover:not
(:active
) {
236 background-color: var
(--uei-button-hover-bgcolor
);
237 color: var
(--uei-button-hover-color
);
238 border-color: var
(--uei-button-hover-bgcolor
);
242 .unified-extensions-item-action:not
([disabled
]).subviewbutton
,
243 .unified-extensions-item-open-menu
.subviewbutton
,
244 toolbaritem
.unified-extensions-item
.unified-extensions-action:not
([disabled
]).subviewbutton
,
245 toolbaritem
.unified-extensions-item
.unified-extensions-item-open-menu
.subviewbutton
247 background-color: var
(--uei-button-active-bgcolor
);
248 color: var
(--uei-button-active-color
);