Bug 1899248 - Use light-dark() instead of a media query where possible. Mail part 2 r=aleca

Differential Revision: https://phabricator.services.mozilla.com/D211828

--HG--
extra : amend_source : 1bf135ec879ce11e2002e62985024be32b88e68c
extra : histedit_source : ffdc489814ea5c7fd209e8b59fbabb66eefd265f
This commit is contained in:
Richard Marti 2024-05-29 16:31:49 +00:00
Родитель 221a869655
Коммит a6ef23bcb9
14 изменённых файлов: 54 добавлений и 211 удалений

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

@ -3,33 +3,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
:root {
--folder-color-inbox: var(--color-blue-50);
--folder-color-draft: var(--color-purple-50);
--folder-color-sent: var(--color-green-60);
--folder-color-archive: var(--color-brown-60);
--folder-color-spam: var(--color-red-60);
--folder-color-trash: var(--color-ink-60);
--folder-color-template: var(--color-gray-60);
--folder-color-newsletter: var(--color-gray-60);
--folder-color-rss: var(--color-orange-60);
--folder-color-outbox: var(--color-teal-60);
--folder-color-folder: var(--color-yellow-50);
--folder-color-folder-filter: var(--color-magenta-60);
--folder-color-folder-rss: var(--color-orange-60);
@media (prefers-color-scheme: dark) {
--folder-color-inbox: var(--color-blue-30);
--folder-color-draft: var(--color-purple-30);
--folder-color-sent: var(--color-green-30);
--folder-color-archive: var(--color-brown-30);
--folder-color-spam: var(--color-red-30);
--folder-color-trash: var(--color-ink-30);
--folder-color-template: var(--color-gray-10);
--folder-color-newsletter: var(--color-gray-10);
--folder-color-rss: var(--color-orange-30);
--folder-color-outbox: var(--color-teal-30);
--folder-color-folder: var(--color-yellow-10);
--folder-color-folder-filter: var(--color-magenta-30);
--folder-color-folder-rss: var(--color-orange-30);
}
--folder-color-inbox: light-dark(var(--color-blue-50), var(--color-blue-30));
--folder-color-draft: light-dark(var(--color-purple-50), var(--color-purple-30));
--folder-color-sent: light-dark(var(--color-green-60), var(--color-green-30));
--folder-color-archive: light-dark(var(--color-brown-60), var(--color-brown-30));
--folder-color-spam: light-dark(var(--color-red-60), var(--color-red-30));
--folder-color-trash: light-dark(var(--color-ink-60), var(--color-ink-30));
--folder-color-template: light-dark(var(--color-gray-60), var(--color-gray-10));
--folder-color-newsletter: light-dark(var(--color-gray-60), var(--color-gray-10));
--folder-color-rss: light-dark(var(--color-orange-60), var(--color-orange-30));
--folder-color-outbox: light-dark(var(--color-teal-60), var(--color-teal-30));
--folder-color-folder: light-dark(var(--color-yellow-50), var(--color-yellow-10));
--folder-color-folder-filter: light-dark(var(--color-magenta-60), var(--color-magenta-30));
--folder-color-folder-rss: light-dark(var(--color-orange-60), var(--color-orange-30));
}

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

@ -19,19 +19,13 @@ body {
}
#body {
--dateColor: var(--color-gray-20);
--dateTextColor: var(--color-gray-90);
--dateColor: light-dark(var(--color-gray-20), var(--color-gray-60));
--dateTextColor: light-dark(var(--color-gray-90), var(--color-white));
--barColor: var(--selected-item-color);
--barHlColor: var(--linkColor);
--dateHLColor: var(--selected-item-color);
--panelHoverColor: inherit;
--linkColor: var(--color-blue-70);
@media (prefers-color-scheme: dark) {
--dateColor: var(--color-gray-60);
--dateTextColor: var(--color-white);
--linkColor: var(--color-blue-30);
}
--linkColor: light-dark(var(--color-blue-70), var(--color-blue-30));
@media (prefers-contrast) {
--panelHoverColor: SelectedItemText;

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

@ -14,10 +14,10 @@ dialog {
--dialog-text-color: var(--arrowpanel-color);
--dialog-background-color: var(--arrowpanel-background);
--dialog-box-text-color: #181920;
--dialog-box-background-color: #fff;
--dialog-box-border-color: rgba(0, 0, 0, 0.3);
--dialog-box-border-hover-color: rgba(128, 128, 128, 0.8);
--dialog-box-text-color: light-dark(#181920, #f9f9fa);
--dialog-box-background-color: light-dark(#fff, #353537);
--dialog-box-border-color: light-dark(rgba(0, 0, 0, 0.3), hsla(0, 0%, 70%, 0.4));
--dialog-box-border-hover-color: light-dark(rgba(128, 128, 128, 0.8), hsla(0, 0%, 70%, 0.5));
--dialog-button-text-color-hover: currentColor;
--dialog-button-background-color: color-mix(in srgb, currentColor 13%, transparent);
--dialog-button-background-color-hover: color-mix(in srgb, currentColor 17%, transparent);
@ -27,17 +27,6 @@ dialog {
--dialog-primary-background-hover: color-mix(in srgb, var(--dialog-highlight-color) 85%, black);
--dialog-primary-background-active: color-mix(in srgb, var(--dialog-highlight-color) 78%, black);
@media (prefers-color-scheme: dark) {
--dialog-text-color: rgb(251, 251, 254);
--dialog-background-color: #2a2a2e;
--dialog-box-text-color: #f9f9fa;
--dialog-box-background-color: #353537;
--dialog-box-border-color: hsla(0, 0%, 70%, 0.4);
--dialog-box-border-hover-color: hsla(0, 0%, 70%, 0.5);
--dialog-highlight-color: #45a1ff;
--dialog-highlight-text-color: rgb(43, 42, 51);
}
@media (prefers-contrast) {
--dialog-box-text-color: color-mix(in srgb, currentColor 41%, transparent);
--dialog-box-background-color: color-mix(in srgb, currentColor 41%, transparent);

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

@ -18,26 +18,15 @@
--panel-border-radius: 3px;
@media not (prefers-contrast) {
--in-content-button-color: #0c0c0d;
--in-content-button-border: #c2c2c3;
--in-content-button-background: #e2e2e3;
--in-content-button-color-hover: #0c0c0d;
--in-content-button-background-hover: #d2d2d3;
--in-content-button-border-active: #a2a2a3;
--in-content-button-color-active: #0c0c0d;
--in-content-button-background-active: #c2c2c3;
--in-content-button-color: light-dark(#0c0c0d, #f9f9fa);
--in-content-button-border: light-dark(#c2c2c3, #828283);
--in-content-button-background: light-dark(#e2e2e3, #636364);
--in-content-button-color-hover: light-dark(#0c0c0d, #f9f9fa);
--in-content-button-background-hover: light-dark(#d2d2d3, #777778);
--in-content-button-border-active: light-dark(#a2a2a3, #878788);
--in-content-button-color-active: light-dark(#0c0c0d, #f9f9fa);
--in-content-button-background-active: light-dark(#c2c2c3, #878788);
--in-content-box-info-background: light-dark(var(--layout-background-0), var(--layout-background-2));
@media (prefers-color-scheme: dark) {
--in-content-button-color: #f9f9fa;
--in-content-button-border: #828283;
--in-content-button-background: #636364;
--in-content-button-color-hover: #f9f9fa;
--in-content-button-background-hover: #777778;
--in-content-button-color-active: #f9f9fa;
--in-content-button-border-active: #878788;
--in-content-button-background-active: #878788;
}
}
@media (prefers-contrast) {

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

@ -24,42 +24,22 @@
:host,
:root {
--layout-background-0: var(--color-white);
--layout-background-1: var(--color-gray-05);
--layout-background-2: var(--color-gray-10);
--layout-background-3: var(--color-gray-20);
--layout-background-4: var(--color-gray-30);
--layout-background-0: light-dark(var(--color-white), var(--color-gray-90));
--layout-background-1: light-dark(var(--color-gray-05), var(--color-gray-80));
--layout-background-2: light-dark(var(--color-gray-10), var(--color-gray-70));
--layout-background-3: light-dark(var(--color-gray-20), var(--color-gray-60));
--layout-background-4: light-dark(var(--color-gray-30), var(--color-gray-50));
--layout-color-0: var(--color-black);
--layout-color-1: var(--color-gray-90);
--layout-color-2: var(--color-gray-70);
--layout-color-0: light-dark(var(--color-black), var(--color-white));
--layout-color-1: light-dark(var(--color-gray-90), var(--color-gray-10));
--layout-color-2: light-dark(var(--color-gray-70), var(--color-gray-30));
--layout-color-3: var(--color-gray-50);
--layout-border-0: var(--color-gray-30);
--layout-border-1: var(--color-gray-40);
--layout-border-0: light-dark(var(--color-gray-30), var(--color-gray-70));
--layout-border-1: light-dark(var(--color-gray-40), var(--color-gray-60));
--layout-border-2: var(--color-gray-50);
}
@media (prefers-color-scheme: dark) {
:host,
:root {
--layout-background-0: var(--color-gray-90);
--layout-background-1: var(--color-gray-80);
--layout-background-2: var(--color-gray-70);
--layout-background-3: var(--color-gray-60);
--layout-background-4: var(--color-gray-50);
--layout-color-0: var(--color-white);
--layout-color-1: var(--color-gray-10);
--layout-color-2: var(--color-gray-30);
--layout-color-3: var(--color-gray-50);
--layout-border-0: var(--color-gray-70);
--layout-border-1: var(--color-gray-60);
--layout-border-2: var(--color-gray-50);
}
}
@media (prefers-contrast) {
:host,
:root:not([lwtheme]) {

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

@ -12,8 +12,8 @@
--recipient-avatar-placeholder-size: 16px;
--recipient-avatar-margin-block-start: -1px;
--recipient-avatar-color: var(--color-gray-50);
--recipient-avatar-background-color: var(--color-gray-30);
--recipient-avatar-color: light-dark(var(--color-gray-50), var(--color-gray-40));
--recipient-avatar-background-color: light-dark(var(--color-gray-30), var(--color-gray-60));
--recipient-multi-line-gap: 2px;
--message-header-label-opacity: 0.7;
@ -42,11 +42,6 @@
& .message-header-show-big-avatar {
--recipient-avatar-size: 40px;
}
@media (prefers-color-scheme: dark) {
--recipient-avatar-color: var(--color-gray-40);
--recipient-avatar-background-color: var(--color-gray-60);
}
}
#messagepanebox {

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

@ -527,13 +527,13 @@ menubar {
font-size: inherit;
}
:root[lwtheme] menubar > menu[_moz-menuactive="true"]:not([disabled="true"]) {
background-color: hsla(0, 0%, 0%, 0.12);
color: inherit;
#mail-menubar {
color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
background-color: hsla(0, 0%, 100%, 0.22);
}
#mail-menubar > menu[_moz-menuactive="true"]:not([disabled="true"]) {
background-color: light-dark(hsla(0, 0%, 0%, 0.12), hsla(0, 0%, 100%, 0.22));
color: inherit;
}
menulist {
@ -918,12 +918,6 @@ statuspanel {
background-color: var(--layout-background-1);
border-top: 1px solid var(--splitter-color);
min-height: 22px;
@media (prefers-color-scheme: dark) {
:root[lwtheme] & {
border-top-color: var(--lwt-accent-color);
}
}
}
:root[lwtheme] #status-bar {

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

@ -14,11 +14,6 @@
color: -moz-DialogText;
opacity: 0;
@media (prefers-color-scheme: dark) {
background-color: #2a2a2e;
color: #f9f9fa;
}
&[noanimation] {
opacity: 1;
}
@ -77,10 +72,6 @@
margin-block: 0.4em;
margin-inline-start: 11px;
border-top: 1px solid -moz-DialogText;
@media (prefers-color-scheme: dark) {
border-top-color: #f9f9fa;
}
}
folder-summary {

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

@ -5,7 +5,7 @@
/* Colors variables */
:root {
--spaces-bg-color: #e8e8e8;
--spaces-bg-color: light-dark(#e8e8e8, #252525);
--spaces-bg-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
--spaces-button-text-color: currentColor;
--spaces-button-active-text-color: var(--button-primary-text-color);
@ -20,10 +20,6 @@
--spaces-bg-image: none;
}
@media (prefers-color-scheme: dark) {
--spaces-bg-color: #252525;
}
@media (prefers-contrast) {
&:not([lwtheme]) {
--spaces-bg-color: -moz-Dialog;

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

@ -52,6 +52,7 @@
appearance: none;
align-items: stretch;
flex: 100 100;
color-scheme: light dark;
background-color: transparent;
border-radius: 4px 4px 0 0;
border-width: 0;
@ -249,10 +250,7 @@ button.tab-close-button {
/* Tab hover */
.tabmail-tab:hover .tab-background:not([selected=true]) {
background-color: rgba(0, 0, 0, 0.1);
@media (prefers-color-scheme: dark) {
background-color: rgba(255, 255, 255, 0.05);
background-color: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.05));
}
}
@ -266,11 +264,7 @@ button.tab-close-button {
.tabmail-tab:hover .tab-line:not([selected=true]) {
opacity: 1;
transform: none;
background-color: rgba(0, 0, 0, 0.2);
@media (prefers-color-scheme: dark) {
background-color: rgba(255, 255, 255, 0.15);
}
background-color: light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.15));
}
/**

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

@ -166,17 +166,6 @@
:root {
--lwt-accent-color: rgb(24, 24, 26);
}
:root[lwtheme]:not([lwt-tree]) {
--button-background-color: var(--layout-background-3);
--button-hover-background-color: var(--layout-background-4);
--button-active-background-color: var(--layout-background-2);
--button-link-text-color: var(--color-blue-40);
--button-link-active-text-color: var(--color-blue-50);
--arrowpanel-border-color: #52525e;
--default: #dcdcdc;
--primary: var(--color-blue-40);
}
}
/* Special High contrast setting */

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

@ -13,22 +13,6 @@
/* ::::: special toolbar colors ::::: */
@media not (prefers-contrast) {
#menubar-items > #mail-menubar > menu {
&[disabled="true"] {
background-color: transparent;
}
&:not([disabled="true"])[_moz-menuactive="true"] {
background-color: hsla(0, 0%, 0%, .12);
@media (prefers-color-scheme: dark) {
background-color: hsla(0, 0%, 100%, .2);
}
}
}
}
#composeContentBox {
appearance: none;
color: -moz-dialogtext;

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

@ -150,26 +150,16 @@ treechildren::-moz-tree-row(dummy, selected, focus) {
@media not (prefers-contrast) {
&:hover {
background-color: hsla(0, 0%, 0%, 0.12);
background-color: light-dark(hsla(0, 0%, 0%, 0.12), hsla(0, 0%, 100%, 0.12));
&:active {
background-color: hsla(0, 0%, 0%, 0.22);
background-color: light-dark(hsla(0, 0%, 0%, 0.22), hsla(0, 0%, 100%, 0.22));
}
}
&:not(:hover) > .toolbarbutton-icon:-moz-window-inactive {
opacity: 0.5;
}
@media (prefers-color-scheme: dark) {
&:hover {
background-color: hsla(0, 0%, 100%, 0.12);
&:active {
background-color: hsla(0, 0%, 100%, 0.22);
}
}
}
}
:root[lwtheme-image] & {
@ -249,20 +239,10 @@ treechildren::-moz-tree-row(dummy, selected, focus) {
@media not (prefers-contrast) {
&:hover {
stroke: white;
background-color: var(--color-red-60);
background-color: light-dark(var(--color-red-60), var(--color-red-70));
&:hover:active {
background-color: var(--color-red-50);
}
}
@media (prefers-color-scheme: dark) {
&:hover {
background-color: var(--color-red-70);
&:hover:active {
background-color: var(--color-red-60);
}
background-color: light-dark(var(--color-red-50), var(--color-red-60));
}
}
}

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

@ -30,22 +30,6 @@
--autocomplete-popup-url-color: hsl(210, 77%, 47%);
}
@media (prefers-color-scheme: dark) {
&[lwtheme] {
--autocomplete-popup-highlight-color: var(--lwt-text-color);
--dark-lwt-highlight-color: #0a84ff;
}
&[lwtheme]:not([lwt-tree]) menupopup {
--panel-background: var(--arrowpanel-background) !important;
--panel-color: var(--arrowpanel-color) !important;
--panel-border-color: var(--arrowpanel-border-color) !important;
--menu-color: var(--arrowpanel-color) !important;
--menu-disabled-color: color-mix(in srgb, var(--arrowpanel-color) 35%, transparent) !important;
--menuitem-hover-background-color: color-mix(in srgb, var(--arrowpanel-color) 13%, transparent) !important;
}
}
@media (prefers-contrast) {
&:not([lwtheme]) {
--lwt-tabs-border-color: ThreeDShadow;