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-02-21 15:17:39 +00:00
|
|
|
|
2024-03-26 21:17:57 +00:00
|
|
|
// Import CSS variable values from Codex
|
|
|
|
// TODO in the future this should be managed by MW core instead
|
2024-04-19 17:51:48 +00:00
|
|
|
@import ( less ) 'mediawiki.skin.codex-design-tokens/theme-codex-wikimedia-experimental.css';
|
2024-03-26 21:17:57 +00:00
|
|
|
|
|
|
|
// :extend merges this :root selector into the one provided by theme-codex-wikimedia-experimental.less.
|
2024-03-07 21:39:00 +00:00
|
|
|
:root:extend( :root ) {
|
2024-03-04 22:43:15 +00:00
|
|
|
--minerva-diff-addedline: @color-success;
|
|
|
|
--minerva-diff-deletedline: @color-destructive;
|
|
|
|
--box-shadow-color-drawer: rgba( 0, 0, 0, 0.35 );
|
|
|
|
}
|
|
|
|
|
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-02-13 14:50:30 +00:00
|
|
|
--color-base: #f8f9fa;
|
|
|
|
--color-subtle: #d4d5d5;
|
|
|
|
--color-link: #6e85d8;
|
|
|
|
--color-link-red: #e45d52;
|
|
|
|
--color-progressive: #6e85d8;
|
|
|
|
--background-color-destructive: #e45d52;
|
|
|
|
--color-progressive--active: #afb6e9;
|
|
|
|
--background-color-base: #101418;
|
|
|
|
--color-visited: #977dbd;
|
|
|
|
--background-color-interactive: #202122;
|
|
|
|
--background-color-interactive-subtle: #202122;
|
|
|
|
--background-color-progressive-subtle: #202122;
|
2024-04-01 14:47:02 +00:00
|
|
|
--background-color-neutral: #202122;
|
2024-04-01 01:17:11 +00:00
|
|
|
--background-color-neutral-subtle: #202122;
|
2024-02-13 14:50:30 +00:00
|
|
|
--border-color-base: #2e3136;
|
|
|
|
--border-color-inverted: #f8f9fa;
|
2024-02-14 21:18:21 +00:00
|
|
|
--border-color-muted: #2e3136;
|
2024-02-13 14:50:30 +00:00
|
|
|
--border-color-progressive--focus: #afb6e9;
|
|
|
|
--border-color-subtle: #d4d5d5;
|
|
|
|
--border-color-transparent: transparent;
|
|
|
|
--box-shadow-color-progressive--focus: #afb6e9;
|
2024-03-04 22:43:15 +00:00
|
|
|
--color-error: #f8a397;
|
2024-02-13 14:50:30 +00:00
|
|
|
--color-inverted: #f8f9fa;
|
|
|
|
--color-link-red--visited: #b97876;
|
|
|
|
--color-link-external: #6e85d8;
|
|
|
|
--color-link-external--visited: #b97876;
|
|
|
|
--color-link-external--active: #2a4b8d;
|
2024-02-16 14:35:19 +00:00
|
|
|
--color-link--visited: #977dbd;
|
2024-02-27 19:17:07 +00:00
|
|
|
--box-shadow-color-drawer: #000;
|
2024-02-23 19:33:12 +00:00
|
|
|
--color-emphasized: #fff;
|
2024-03-04 22:43:15 +00:00
|
|
|
|
|
|
|
// Message box colors. [[T358402#9598616]]
|
|
|
|
--background-color-error-subtle: #70231f;
|
|
|
|
--background-color-warning-subtle: #4f3a1a;
|
|
|
|
--background-color-success-subtle: #194538;
|
|
|
|
--background-color-notice-subtle: #202122;
|
|
|
|
--border-color-error: #e45d52;
|
|
|
|
--border-color-warning: #ad822b;
|
|
|
|
--border-color-success: #0f9b7a;
|
|
|
|
--border-color-notice: #72777d;
|
|
|
|
--color-warning: #e7b032;
|
|
|
|
--color-success: #74c9ac;
|
|
|
|
--color-notice: #f8f9fa;
|
|
|
|
|
|
|
|
--minerva-diff-deletedline: #886525;
|
|
|
|
--minerva-diff-addedline: #36c;
|
2024-02-01 17:33:08 +00:00
|
|
|
}
|
|
|
|
|
2024-02-27 19:17:07 +00:00
|
|
|
/**
|
2024-03-07 21:39:00 +00:00
|
|
|
* == Forced night mode ==
|
|
|
|
* Applies the night mode color palette per the users explicit preference,
|
|
|
|
* regardless of system settings.
|
|
|
|
*/
|
2024-03-18 19:14:23 +00:00
|
|
|
html.skin-theme-clientpref-night {
|
2024-02-27 19:17:07 +00:00
|
|
|
color-scheme: dark;
|
|
|
|
.mixin-night-mode-palette();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-03-07 21:39:00 +00:00
|
|
|
* == Auto night mode ==
|
|
|
|
* Applies the night mode color palette only in response to system settings.
|
|
|
|
*/
|
2024-02-01 17:33:08 +00:00
|
|
|
@media ( prefers-color-scheme: dark ) {
|
2024-03-18 19:14:23 +00:00
|
|
|
html.skin-theme-clientpref-os {
|
2024-02-29 22:46:54 +00:00
|
|
|
color-scheme: light dark;
|
2024-02-27 19:17:07 +00:00
|
|
|
.mixin-night-mode-palette();
|
|
|
|
}
|
2024-03-07 21:39:00 +00:00
|
|
|
}
|
2024-02-27 19:17:07 +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
|
|
|
|
* the light mode color palette, and includes an opinionated color: var( --color-base ); rule
|
|
|
|
* since the main assumption underlying the light theme is black text.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* stylelint-disable-next-line block-no-empty */
|
|
|
|
.skin-invert:extend( :root ),
|
|
|
|
.notheme:extend( :root ) {
|
|
|
|
}
|
2024-02-23 18:18:11 +00:00
|
|
|
|
2024-03-07 21:39:00 +00:00
|
|
|
.skin-invert,
|
|
|
|
.notheme {
|
|
|
|
color-scheme: light;
|
|
|
|
color: var( --color-base );
|
|
|
|
}
|
|
|
|
|
2024-03-18 19:14:23 +00:00
|
|
|
html.skin-theme-clientpref-night .skin-invert {
|
2024-03-07 21:39:00 +00:00
|
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
|
|
|
}
|
|
|
|
|
|
|
|
@media ( prefers-color-scheme: dark ) {
|
2024-03-18 19:14:23 +00:00
|
|
|
html.skin-theme-clientpref-os .skin-invert {
|
2024-02-27 19:17:07 +00:00
|
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
2024-02-01 17:33:08 +00:00
|
|
|
}
|
|
|
|
}
|