2024-02-01 17:33:08 +00:00
|
|
|
/**
|
|
|
|
* Minerva CSS Custom properties
|
|
|
|
* ----------------------------
|
|
|
|
* Please be aware that these properties are accessible via *any* client-side code.
|
|
|
|
* These variables should mirror Codex design token names and values:
|
|
|
|
* https://doc.wikimedia.org/codex/latest/design-tokens
|
|
|
|
* Only include properties that are required for client-side modification.
|
|
|
|
*
|
|
|
|
* @private - Currently, these variables are only intended for use by Minerva,
|
|
|
|
* however, they are designed to mimic the naming convention in Codex tokens
|
|
|
|
* in order to facilitate an eventual migration to a centralized source.
|
|
|
|
* @experimental
|
|
|
|
* @since February 2024 (MediaWiki 1.43)
|
|
|
|
*/
|
|
|
|
|
2024-03-26 21:17:57 +00:00
|
|
|
@import 'mediawiki.skin.variables.less';
|
2024-04-30 20:19:57 +00:00
|
|
|
@import 'mediawiki.skin.codex-design-tokens/theme-wikimedia-ui-mixin-dark.less';
|
2024-05-02 23:16:38 +00:00
|
|
|
@import 'mediawiki.skin.codex-design-tokens/theme-wikimedia-ui-reset.less';
|
2024-03-04 22:43:15 +00:00
|
|
|
|
2024-02-27 19:17:07 +00:00
|
|
|
/**
|
2024-03-07 21:39:00 +00:00
|
|
|
* Placeholder Night mode color palette.
|
|
|
|
* NOTE: These values are temporarily hard coded.
|
|
|
|
*/
|
2024-02-27 19:17:07 +00:00
|
|
|
.mixin-night-mode-palette() {
|
2024-03-24 01:14:15 +00:00
|
|
|
.cdx-mode-dark();
|
2024-02-01 17:33:08 +00:00
|
|
|
}
|
|
|
|
|
2024-03-07 21:39:00 +00:00
|
|
|
/**
|
|
|
|
* == Night-mode helpers ==
|
|
|
|
* The following classes are provided to help third-parties deal with night mode when using the
|
|
|
|
* CSS color variables is not feasible.
|
|
|
|
*
|
|
|
|
* .skin-invert - This class implements an inverted night-mode effect on applied elements using
|
|
|
|
* a CSS filter instead of CSS custom properties. For this effect to work, the light mode palette
|
|
|
|
* has to be applied to avoid inverting night-mode colors.
|
|
|
|
*
|
|
|
|
* .notheme - This class prevents night mode from being applied to a specific element. It needs the
|
2024-06-10 20:52:01 +00:00
|
|
|
* the light mode color palette, and includes an opinionated color: @color-base; rule
|
2024-03-07 21:39:00 +00:00
|
|
|
* since the main assumption underlying the light theme is black text.
|
|
|
|
*/
|
|
|
|
|
2024-05-02 23:16:38 +00:00
|
|
|
/**
|
|
|
|
* Light mode
|
|
|
|
*
|
|
|
|
* Applies the light mode color palette by default
|
|
|
|
* or with the .skin-invert, or .notheme classes
|
|
|
|
*/
|
|
|
|
:root,
|
|
|
|
.skin-invert,
|
|
|
|
.notheme {
|
|
|
|
.cdx-mode-reset();
|
2024-03-07 21:39:00 +00:00
|
|
|
}
|
2024-02-23 18:18:11 +00:00
|
|
|
|
2024-03-07 21:39:00 +00:00
|
|
|
.skin-invert,
|
|
|
|
.notheme {
|
|
|
|
color-scheme: light;
|
2024-06-10 20:52:01 +00:00
|
|
|
color: @color-base;
|
2024-03-07 21:39:00 +00:00
|
|
|
}
|
|
|
|
|
2024-06-03 18:19:51 +00:00
|
|
|
/**
|
|
|
|
* == Forced night mode ==
|
|
|
|
* Applies the night mode color palette per the users explicit preference,
|
|
|
|
* regardless of system settings.
|
|
|
|
*/
|
|
|
|
html.skin-theme-clientpref-night {
|
|
|
|
color-scheme: dark;
|
|
|
|
.mixin-night-mode-palette();
|
|
|
|
|
|
|
|
.skin-invert,
|
|
|
|
.skin-invert-image img,
|
|
|
|
/* Special treatment of inverted OOUI icons, see T365764 */
|
2024-07-01 18:08:51 +00:00
|
|
|
.oo-ui-iconElement-icon:not( .oo-ui-image-progressive ):not( .oo-ui-image-destructive ):not( .oo-ui-checkboxInputWidget-checkIcon ):not( .oo-ui-image-invert ):not( .mw-no-invert ),
|
2024-06-03 18:19:51 +00:00
|
|
|
.oo-ui-indicatorElement-indicator {
|
|
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Do not apply invert to elements that are inside a notheme or a skin-invert class to avoid inversion in light theme or
|
|
|
|
double inversion in an already inverted element */
|
|
|
|
.skin-invert,
|
|
|
|
.notheme {
|
2024-07-01 18:08:51 +00:00
|
|
|
.oo-ui-iconElement-icon:not( .oo-ui-image-progressive ):not( .oo-ui-image-destructive ):not( .oo-ui-checkboxInputWidget-checkIcon ):not( .oo-ui-image-invert ):not( .mw-no-invert ),
|
2024-06-03 18:19:51 +00:00
|
|
|
.oo-ui-indicatorElement-indicator {
|
|
|
|
filter: none !important;
|
|
|
|
}
|
|
|
|
}
|
2024-03-07 21:39:00 +00:00
|
|
|
}
|
|
|
|
|
2024-06-03 18:19:51 +00:00
|
|
|
/**
|
|
|
|
* == Auto night mode ==
|
|
|
|
* Applies the night mode color palette only in response to system settings.
|
|
|
|
*/
|
2024-03-07 21:39:00 +00:00
|
|
|
@media ( prefers-color-scheme: dark ) {
|
2024-06-03 18:19:51 +00:00
|
|
|
html.skin-theme-clientpref-os {
|
|
|
|
color-scheme: light dark;
|
|
|
|
.mixin-night-mode-palette();
|
|
|
|
|
|
|
|
.skin-invert,
|
|
|
|
.skin-invert-image img,
|
|
|
|
.oo-ui-iconElement-icon:not( .oo-ui-image-progressive ):not( .oo-ui-image-destructive ):not( .oo-ui-checkboxInputWidget-checkIcon ),
|
|
|
|
.oo-ui-indicatorElement-indicator {
|
|
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Do not apply invert to elements that are inside a notheme or a skin-invert class to avoid inversion in light theme or
|
|
|
|
double inversion in an already inverted element */
|
|
|
|
.skin-invert,
|
|
|
|
.notheme {
|
|
|
|
.oo-ui-iconElement-icon:not( .oo-ui-image-progressive ):not( .oo-ui-image-destructive ):not( .oo-ui-checkboxInputWidget-checkIcon ),
|
|
|
|
.oo-ui-indicatorElement-indicator {
|
|
|
|
filter: none !important;
|
|
|
|
}
|
|
|
|
}
|
2024-02-01 17:33:08 +00:00
|
|
|
}
|
|
|
|
}
|