Bug 1656494 - Style changes for larger notification bar. r=ntim

Differential Revision: https://phabricator.services.mozilla.com/D87492
This commit is contained in:
Jared Wein 2020-08-23 06:57:11 +00:00
Родитель 364ba866a7
Коммит 410fe143f2
5 изменённых файлов: 96 добавлений и 51 удалений

Просмотреть файл

@ -51,6 +51,7 @@ var DefaultBrowserNotificationOnNewTabPage = {
let buttons = [ let buttons = [
{ {
"l10n-id": "default-browser-notification-button", "l10n-id": "default-browser-notification-button",
primary: true,
callback: () => { callback: () => {
ShellService.setAsDefault(); ShellService.setAsDefault();
this.closePrompt(); this.closePrompt();

Просмотреть файл

@ -1617,7 +1617,7 @@ BrowserGlue.prototype = {
win.gNotificationBox.appendNotification( win.gNotificationBox.appendNotification(
message, message,
"reset-profile-notification", "reset-profile-notification",
"chrome://global/skin/icons/question-16.png", "chrome://global/skin/icons/question-64.png",
win.gNotificationBox.PRIORITY_INFO_LOW, win.gNotificationBox.PRIORITY_INFO_LOW,
buttons buttons
); );

Просмотреть файл

@ -191,6 +191,10 @@
} }
buttonElem.classList.add("notification-button"); buttonElem.classList.add("notification-button");
if (button.primary) {
buttonElem.classList.add("primary");
}
newitem.messageDetails.appendChild(buttonElem); newitem.messageDetails.appendChild(buttonElem);
buttonElem.buttonInfo = button; buttonElem.buttonInfo = button;
} }

Просмотреть файл

@ -160,37 +160,6 @@ html|input {
margin: 4px; margin: 4px;
} }
xul|notification > xul|hbox > xul|button {
margin: 0 3px;
padding: 1px 10px;
min-width: 60px;
min-height: 16px;
appearance: none;
border-radius: 10000px;
border: @roundButtonBorderWidth@ @roundButtonBorderStyle@ @roundButtonBorderColor@;
color: @roundButtonColor@;
background: @roundButtonBackgroundImage@;
box-shadow: @roundButtonShadow@;
}
xul|notification > xul|hbox > xul|button:active:hover {
color: @roundButtonColor@;
background: @roundButtonPressedBackgroundImage@;
box-shadow: @roundButtonPressedShadow@;
}
xul|notification > xul|hbox > xul|button:-moz-focusring {
box-shadow: var(--focus-ring-box-shadow), @roundButtonShadow@;
}
xul|notification > xul|hbox > xul|button:active:hover:-moz-focusring {
box-shadow: var(--focus-ring-box-shadow), @roundButtonPressedShadow@;
}
xul|notification > xul|hbox > xul|button > .button-box > .button-text {
margin: 0 !important;
}
xul|popupnotificationcontent { xul|popupnotificationcontent {
margin-top: .5em; margin-top: .5em;
} }

Просмотреть файл

@ -5,18 +5,47 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.notificationbox-stack { .notificationbox-stack {
/* Prevent the animation from overlapping the navigation toolbar */
overflow: clip; overflow: clip;
} }
.notificationbox-stack[notificationside="top"] {
/* Create a stacking context for the box-shadow */
position: relative;
z-index: 1;
box-shadow: 0 3px 10px -7px #000;
}
notification { notification {
padding: 2px 0 3px; height: 56px;
padding-inline-start: 12px; padding-inline-start: 16px;
background: -moz-dialog; background: var(--notification-background);
color: -moz-dialogText; color: var(--notification-text);
border-color: ThreeDLightShadow; border-color: var(--notification-border);
border-style: solid; border-style: solid;
border-width: 1px 0; border-width: 1px 0;
text-shadow: none; text-shadow: none;
font-size: 1.15em;
--notification-background: Window;
--notification-text: WindowText;
--notification-border: rgba(12, 12, 13, 0.2);
--notification-button-background: rgba(12,12,13,.1);
--notification-button-background-hover: rgba(12,12,13,0.2);
--notification-button-background-active: rgba(12,12,13,0.3);
--notification-button-text: inherit;
--notification-primary-button-background: #0060df;
--notification-primary-button-background-hover: #003eaa;
--notification-primary-button-background-active: #002275;
--notification-primary-button-text: rgb(249, 249, 250);
}
notification[type="info"]:-moz-lwtheme-brighttext {
--notification-background: #38383d;
--notification-text: rgb(249, 249, 250);
--notification-button-background: rgba(249,249,250,.1);
--notification-button-background-hover: rgba(249,249,250,.2);
--notification-button-background-active: rgba(249,249,250,.3);
} }
notification.animated { notification.animated {
@ -31,24 +60,27 @@ notification.animated {
border-bottom-style: none; border-bottom-style: none;
} }
notification[type="warning"],
notification[type="critical"] {
border-color: rgba(12, 12, 13, 0.2);
}
notification[type="warning"] { notification[type="warning"] {
background: #ffe900; --notification-background: #ffe900;
color: #0c0c0d; --notification-text: #0c0c0d;
} }
notification[type="critical"] { notification[type="critical"] {
background: #d70022; --notification-background: #d70022;
color: #fff; --notification-text: #fff;
}
notification[type="critical"] > .close-icon:hover {
fill-opacity: .2;
}
notification[type="critical"] > .close-icon:hover:active {
fill-opacity: .3;
} }
.messageText { .messageText {
margin-inline-start: 12px !important; margin-inline-start: 12px !important;
margin-bottom: 1px !important; margin-block: 12px;
} }
.messageText > .text-link { .messageText > .text-link {
@ -61,8 +93,8 @@ notification[type="critical"] {
} }
.messageImage { .messageImage {
width: 16px; width: 32px;
height: 16px; height: 32px;
-moz-context-properties: fill; -moz-context-properties: fill;
fill: currentColor; fill: currentColor;
} }
@ -84,8 +116,47 @@ notification[type="critical"] > hbox > .messageImage {
padding: 0; padding: 0;
} }
/* Close button needs to be clickable from the edge of the window */
.messageCloseButton > .toolbarbutton-icon { .messageCloseButton > .toolbarbutton-icon {
margin-inline-end: 12px; padding: 6px;
/* Override width and height from close-icon.css */
width: 32px !important;
height: 32px !important;
/* Close button needs to be clickable from the edge of the window */
margin-inline-end: 16px;
} }
.notification-button {
appearance: none;
border: 1px solid transparent;
border-radius: 2px;
background-color: var(--notification-button-background);
color: var(--notification-button-text);
padding: 0 8px;
margin: 4px 8px;
height: 32px;
}
.notification-button[disabled] {
opacity: 0.5;
}
.notification-button:not([disabled]):hover {
background-color: var(--notification-button-background-hover);
}
.notification-button:not([disabled]):hover:active {
background-color: var(--notification-button-background-active);
}
.notification-button.primary {
background-color: var(--notification-primary-button-background);
color: var(--notification-primary-button-text);
}
.notification-button.primary:not([disabled]):hover {
background-color: var(--notification-primary-button-background-hover);
}
.notification-button.primary:not([disabled]):hover:active {
background-color: var(--notification-primary-button-background-active);
}