161 lines
3.8 KiB
CSS
161 lines
3.8 KiB
CSS
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
:host {
|
|
/* Icon */
|
|
--message-bar-icon-color: var(--icon-color-information);
|
|
--message-bar-icon-size: var(--size-item-small);
|
|
--message-bar-icon-close-url: url("chrome://global/skin/icons/close.svg");
|
|
|
|
/* Container */
|
|
--message-bar-container-min-height: var(--size-item-large);
|
|
|
|
/* Border */
|
|
--message-bar-border-color: oklch(from var(--message-bar-icon-color) l c h / 20%);
|
|
--message-bar-border-radius: var(--border-radius-small);
|
|
--message-bar-border-width: var(--border-width);
|
|
|
|
/* Text */
|
|
--message-bar-text-color: var(--text-color);
|
|
|
|
/* Background */
|
|
--message-bar-background-color: var(--background-color-information);
|
|
|
|
background-color: var(--message-bar-background-color);
|
|
border: var(--message-bar-border-width) solid var(--message-bar-border-color);
|
|
border-radius: var(--message-bar-border-radius);
|
|
color: var(--message-bar-text-color);
|
|
text-align: start;
|
|
}
|
|
|
|
@media (prefers-contrast) {
|
|
:host {
|
|
--message-bar-border-color: var(--border-color);
|
|
}
|
|
}
|
|
|
|
/* Make the host to behave as a block by default, but allow hidden to hide it. */
|
|
:host(:not([hidden])) {
|
|
display: block;
|
|
}
|
|
|
|
/* MozMessageBar layout */
|
|
|
|
.container {
|
|
display: flex;
|
|
gap: var(--space-small);
|
|
min-height: var(--message-bar-container-min-height);
|
|
padding-inline: var(--space-medium) var(--space-small);
|
|
padding-block: var(--space-small);
|
|
}
|
|
|
|
.content {
|
|
display: flex;
|
|
flex-grow: 1;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: var(--space-small) var(--space-medium);
|
|
margin-inline-start: var(--message-bar-icon-size);
|
|
}
|
|
|
|
.text-container {
|
|
display: flex;
|
|
gap: var(--space-xsmall) var(--space-small);
|
|
padding-block: calc((var(--message-bar-container-min-height) - 1lh) / 2);
|
|
}
|
|
|
|
.text-content {
|
|
display: inline-flex;
|
|
gap: var(--space-xsmall) var(--space-small);
|
|
flex-wrap: wrap;
|
|
word-break: break-word;
|
|
}
|
|
|
|
/* MozMessageBar icon style */
|
|
|
|
.icon-container {
|
|
height: 1lh;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
margin-inline-start: calc(-1 * var(--message-bar-icon-size));
|
|
}
|
|
|
|
.icon {
|
|
width: var(--message-bar-icon-size);
|
|
height: var(--message-bar-icon-size);
|
|
flex-shrink: 0;
|
|
appearance: none;
|
|
-moz-context-properties: fill, stroke;
|
|
fill: currentColor;
|
|
stroke: currentColor;
|
|
color: var(--message-bar-icon-color);
|
|
}
|
|
|
|
/* MozMessageBar heading style */
|
|
|
|
.heading {
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* MozMessageBar message style */
|
|
|
|
.message.has-link-after {
|
|
margin-inline-end: var(--space-xsmall);
|
|
}
|
|
|
|
/* MozMessageBar link style */
|
|
|
|
.link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.link ::slotted(a) {
|
|
margin-inline-end: var(--space-xsmall);
|
|
}
|
|
|
|
/* MozMessageBar actions style */
|
|
|
|
.actions {
|
|
display: none;
|
|
}
|
|
|
|
.actions.active {
|
|
display: inline-flex;
|
|
gap: var(--space-small);
|
|
}
|
|
|
|
.actions ::slotted(button) {
|
|
/* Enforce micro-button width. */
|
|
min-width: fit-content !important;
|
|
|
|
margin: 0 !important;
|
|
padding: var(--space-xsmall) var(--space-large) !important;
|
|
}
|
|
|
|
/* Close icon styles */
|
|
|
|
moz-button::part(button) {
|
|
background-image: var(--message-bar-icon-close-url);
|
|
}
|
|
|
|
@media not (prefers-contrast) {
|
|
/* MozMessageBar colors by message type */
|
|
:host([type="warning"]) {
|
|
--message-bar-background-color: var(--background-color-warning);
|
|
--message-bar-icon-color: var(--icon-color-warning);
|
|
}
|
|
|
|
:host([type="success"]) {
|
|
--message-bar-background-color: var(--background-color-success);
|
|
--message-bar-icon-color: var(--icon-color-success);
|
|
}
|
|
|
|
:host([type="error"]),
|
|
:host([type="critical"]) {
|
|
--message-bar-background-color: var(--background-color-critical);
|
|
--message-bar-icon-color: var(--icon-color-critical);
|
|
}
|
|
}
|