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/. */
6 --info-icon-url: url
("chrome://global/skin/icons/info-filled.svg");
7 --warn-icon-url: url
("chrome://global/skin/icons/warning.svg");
8 --success-icon-url: url
("chrome://global/skin/icons/check.svg");
9 --error-icon-url: url
("chrome://global/skin/icons/error.svg");
10 --close-icon-url: url
("chrome://global/skin/icons/close-12.svg");
11 --close-fill-color: var
(--in-content-icon-color
);
13 --close-icon-size: 28px;
16 :host
([message-bar-type
=infobar
]) {
17 --close-icon-size: 28px;
21 --message-bar-background-color: var
(--in-content-box-info-background
);
22 --message-bar-text-color: var
(--in-content-text-color
);
23 --message-bar-icon-url: var
(--info-icon-url
);
24 /* The default values of --in-content-button* are sufficient, even for dark themes */
27 :host
([type
=warning
]) {
28 --message-bar-icon-url: var
(--warn-icon-url
);
31 :host
([type
=success
]:not
([message-bar-type
=infobar
])) {
32 --message-bar-icon-url: var
(--success-icon-url
);
36 :host
([type
=critical
]) {
37 --message-bar-icon-url: var
(--error-icon-url
);
41 border: 1px solid transparent
;
45 /* Make the host to behave as a block by default, but allow hidden to hide it. */
46 :host
(:not
([hidden
])) {
51 /* Enforce micro-button width. */
52 min-width: -moz-fit-content
!important
;
55 /* MessageBar Grid Layout */
58 background: var
(--message-bar-background-color
);
59 color: var
(--message-bar-text-color
);
67 /* Ensure that the message bar shadow dom elements are vertically aligned. */
71 :host
([align
="center"]) .container
{
72 justify-content: center
;
77 display: inline-block
;
78 /* Ensure that the message bar content is vertically aligned. */
80 /* Ensure that the message bar content is wrapped. */
81 word-break: break-word
;
84 /* MessageBar icon style */
88 width: var
(--icon-size
);
89 height: var
(--icon-size
);
94 display: inline-block
;
96 -moz-context-properties: fill
, stroke
;
100 background-image: var
(--message-bar-icon-url
);
101 background-size: var
(--icon-size
);
102 width: var
(--icon-size
);
103 height: var
(--icon-size
);
106 /* Use a spacer to position the close button at the end, but also support
107 * centering if required. */
112 /* Close icon styles */
114 :host
(:not
([dismissable
])) .close
{
119 background-image: var
(--close-icon-url
);
120 background-repeat: no-repeat
;
121 background-position: center center
;
122 -moz-context-properties: fill
;
126 width: var
(--close-icon-size
);
127 height: var
(--close-icon-size
);
133 @media (prefers-contrast
) {
135 border-color: CanvasText
;
138 .container.infobar::before {
139 background-color: CanvasText
;
143 @media not
(prefers-contrast
) {
144 /* MessageBar colors by message type */
145 /* Colors from: https://design.firefox.com/photon/components/message-bars.html#type-specific-style */
147 :host
([type
=warning
]:not
([message-bar-type
=infobar
])) {
148 /* Ensure colors within the bar are adjusted and controls are readable */
151 --message-bar-background-color: var
(--yellow-50
);
152 --message-bar-text-color: var
(--yellow-90
);
154 --in-content-button-background: var
(--yellow-60
);
155 --in-content-button-background-hover: var
(--yellow-70
);
156 --in-content-button-background-active: var
(--yellow-80
);
158 --close-fill-color: var
(--message-bar-text-color
);
161 :host
([type
=success
]:not
([message-bar-type
=infobar
])) {
162 /* Ensure colors within the bar are adjusted and controls are readable */
165 --message-bar-background-color: var
(--green-50
);
166 --message-bar-text-color: var
(--green-90
);
168 --in-content-button-background: var
(--green-60
);
169 --in-content-button-background-hover: var
(--green-70
);
170 --in-content-button-background-active: var
(--green-80
);
173 :host
([type
=error
]:not
([message-bar-type
=infobar
])) {
174 --message-bar-background-color: var
(--red-60
);
175 --message-bar-text-color: #ffffff;
177 --in-content-button-background: var
(--red-70
);
178 --in-content-button-background-hover: var
(--red-80
);
179 --in-content-button-background-active: var
(--red-90
);
182 :host
([type
=info
]) .icon
{
183 color: rgb
(0,144,237);
186 :host
([type
=warning
]) .icon
{
187 color: rgb
(255,164,54);
190 :host
([type
=critical
]) .icon
{
191 color: rgb
(226,40,80);
195 box-shadow: 0 1px 2px rgba
(58, 57, 68, 0.1);
196 background: var
(--in-content-page-background
);
199 .container.infobar::before {
200 background-image: linear-gradient
(0deg, #9059ff 0%, #ff4aa2 52.08%, #ffbd4f 100%);
204 fill: var
(--close-fill-color
);
207 @media
(prefers-color-scheme: dark
) {
208 /* Don't set the background in prefers-contrast mode or macOS can end up
209 * with black on black text. */
211 background: rgb
(66,65,77);
214 :host
([type
=info
]) .icon
{
215 color: rgb
(128,235,255);
218 :host
([type
=warning
]) .icon
{
219 color: rgb
(255,189,79);
222 :host
([type
=critical
]) .icon
{
223 color: rgb
(255,154,162);
228 :host
([message-bar-type
=infobar
]:first-of-type
) {
232 :host
([message-bar-type
=infobar
]) {
237 /* Don't let lwthemes set a text-shadow. */
242 .container.infobar::before {
248 inset-inline-start: 0;
250 border-start-start-radius: 4px;
251 border-end-start-radius: 4px;
255 align-items: flex-start
;
258 /* Infobars styling. */
259 .notification-content {
261 margin-inline-start: 8px;
265 .notification-message {
267 margin-inline-end: 20px;
268 /* Prevent misalignment issue in the infobar on Linux */
269 @media
(-moz-platform: linux
) {
270 padding-block-start: 6px;
274 .notification-button-container
,
275 .notification-message {
276 display: inline-block
;
277 vertical-align: middle
;
280 .container.infobar > .notification-content > .notification-message img.inline-icon {
281 /* Align inline icon images in the message content */
282 vertical-align: middle
;
283 /* Ensure they get the right fill color. */
284 -moz-context-properties: fill
;
290 background-size: 12px;
293 .notification-button {
298 .notification-button:first-of-type {
299 /* When the buttons wrap to their own line we want to match the 8px on the message. */
300 margin-inline-start: 0;
317 :host
([type
=system
]) .notification-content
{
318 margin-inline-start: 16px;
321 :host
([type
=system
]) .icon
{
326 from
{ transform: rotate
(0); }
327 to
{ transform: rotate
(360deg); }