Enable dark mode for echo overlay

Bug: T366322
Depends-on: I01cdde979b2ddf64d54013466a3fe51a493860cc
Change-Id: I90f2c3c5098a418a7e40204c9b2384711b6ddce3
This commit is contained in:
bwang 2024-06-20 12:34:36 -05:00 committed by Jon Robson
parent 08136cbf03
commit 781d532180
6 changed files with 34 additions and 15 deletions

View file

@ -1,15 +1,15 @@
// = Echo variables
@grey-light: #72777d;
@grey-light: @color-placeholder;
@badge-padding: 0.12em;
@badge-icon-size: 1.1em;
@badge-distance-adjustment: 1em;
@notification-item-background-read: #eaecf0;
@notification-item-background-read: @background-color-neutral;
@notification-background-unseen: #dce8ff;
@notification-background-unread: @background-color-base;
@notification-background-read: #eaecf0;
@notification-background-read: @background-color-neutral;
@badge-counter-background-seen: @grey-light;
@ -32,4 +32,4 @@
@specialpage-width: 1000px;
/* stylelint-enable plugin/no-unsupported-browser-features */
@background-color-popup-confirmation: #202122;
@background-color-popup-confirmation: @color-notice;

View file

@ -117,7 +117,7 @@ ul.mw-echo-special-notifications {
overflow-y: auto;
.mw-echo-notification {
background-color: #f8f9fa;
background-color: @background-color-neutral-subtle;
&:hover {
background-color: #eaecf0;

View file

@ -41,7 +41,7 @@
&-group {
cursor: default;
padding: @bundle-group-padding;
background-color: #f8f9fa;
background-color: @background-color-neutral-subtle;
box-shadow: inset 0 2px 0 0 rgba( 0, 0, 0, 0.05 );
}

View file

@ -25,22 +25,33 @@
cursor: inherit;
}
&:hover {
text-decoration: none;
background-color: #ececec;
}
&:focus {
text-decoration: none;
box-shadow: @box-shadow-inset-medium @box-shadow-color-progressive--focus;
outline: @outline-base--focus;
}
&:hover {
text-decoration: none;
// FIXME: Non-standard design token. Replace with a standard token and revise skin-theme rules.
background-color: #ececec;
.skin-theme-clientpref-night & {
background-color: @background-color-interactive-subtle;
}
.skin-theme-clientpref-os & {
@media ( prefers-color-scheme: dark ) {
background-color: @background-color-interactive-subtle;
}
}
}
&-unread {
background-color: @background-color-base;
&:hover {
background-color: #f8f9fa;
background-color: @background-color-interactive-subtle;
}
}

View file

@ -39,10 +39,18 @@
} );
let $icon;
const iconUrl = this.model.getIconURL();
// Icon
if ( this.model.getIconURL() ) {
if ( iconUrl ) {
// Only invert non colored images
/* eslint-disable es-x/no-array-prototype-includes */
const invertIconClass =
iconUrl.includes( 'progressive' ) ||
iconUrl.includes( 'constructive' ) ||
iconUrl.includes( 'failure' ) ? '' : 'skin-invert';
/* eslint-disable-next-line mediawiki/class-doc */
$icon = $( '<div>' )
.addClass( 'mw-echo-ui-notificationItemWidget-icon' )
.addClass( `mw-echo-ui-notificationItemWidget-icon ${ invertIconClass }` )
.append( $( '<img>' ).attr( {
src: this.model.getIconURL(),
role: 'presentation',

View file

@ -8,6 +8,6 @@
* @property {jQuery}
*/
$overlay: $( '<div>' )
.addClass( 'mw-echo-ui-overlay notheme' )
.addClass( 'mw-echo-ui-overlay' )
};
}() );