2024-03-06 22:12:45 +00:00
|
|
|
@import 'mediawiki.skin.variables.less';
|
|
|
|
@import 'mediawiki.skin.codex-design-tokens/theme-wikimedia-ui-mixin-dark.less';
|
|
|
|
@import 'mediawiki.skin.codex-design-tokens/theme-wikimedia-ui-reset.less';
|
|
|
|
|
2024-05-13 18:34:20 +00:00
|
|
|
/**
|
|
|
|
* FIXME: Temporary Night-mode override classes
|
|
|
|
* Remove these once T363849 has been addressed.
|
|
|
|
*
|
|
|
|
* The following classes are meant to force OOUI interfaces
|
|
|
|
* into light-mode when night-mode is enabled. They should be
|
|
|
|
* grouped with the `.notheme` rulset as an alternative to
|
|
|
|
* using the `.notheme` class in multiple places.
|
|
|
|
*
|
|
|
|
* Note: These are wrapped in quotes to avoid dashed being interpreted as minus signs,
|
|
|
|
* along with a `~` to unwrap them when they are used as selectors.
|
|
|
|
*/
|
2024-06-04 23:16:36 +00:00
|
|
|
@OOUIOverrideSelectors: ~'.ve-ui-overlay, .oo-ui-popupWidget-popup, .oo-ui-toolbar'; // T363861 - VisualEditor Overlays
|
2024-05-13 18:34:20 +00:00
|
|
|
|
2024-06-03 18:30:02 +00:00
|
|
|
/**
|
|
|
|
* T365764 - OOUI Icon classes for inverted dark-mode icons.
|
|
|
|
* This includes OOUI icons that are not colored (progressive/destructive), checkbox icons, and
|
|
|
|
* indicator widgets.
|
|
|
|
*/
|
2024-06-13 15:16:32 +00:00
|
|
|
@OOUIIconSelectors: ~'.oo-ui-iconElement-icon:not( .oo-ui-image-progressive ):not( .oo-ui-image-destructive ):not( .oo-ui-checkboxInputWidget-checkIcon )';
|
|
|
|
@OOUIIndicatorSelectors: ~'.oo-ui-indicatorElement-indicator';
|
2024-06-03 18:30:02 +00:00
|
|
|
|
2023-09-22 17:50:07 +00:00
|
|
|
/**
|
2024-03-06 22:12:45 +00:00
|
|
|
* Light mode
|
2023-09-22 17:50:07 +00:00
|
|
|
*
|
2024-03-06 22:12:45 +00:00
|
|
|
* Applies the light mode color palette by default
|
|
|
|
* or with the .skin-invert, or .notheme classes
|
2023-09-22 17:50:07 +00:00
|
|
|
*/
|
2024-03-06 22:12:45 +00:00
|
|
|
:root,
|
|
|
|
.skin-invert,
|
2024-05-13 18:34:20 +00:00
|
|
|
.notheme,
|
|
|
|
@{OOUIOverrideSelectors} {
|
2024-03-06 22:12:45 +00:00
|
|
|
.cdx-mode-reset();
|
2023-09-22 17:50:07 +00:00
|
|
|
}
|
|
|
|
|
2024-03-06 22:12:45 +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;
|
|
|
|
.cdx-mode-dark();
|
2023-09-22 17:50:07 +00:00
|
|
|
}
|
|
|
|
|
2024-06-03 18:30:02 +00:00
|
|
|
/**
|
2024-06-14 15:32:18 +00:00
|
|
|
* Inverted Dark-mode
|
|
|
|
* Creates a dark-mode effect on elements by flipping their color,
|
|
|
|
* (usually from black to white).
|
|
|
|
* Applied as a last resort when using CSS variables is not possible.
|
|
|
|
* NOTE: `.skin-invert` is used in templates and user generated content.
|
|
|
|
*
|
|
|
|
* - T365102 invert class specifically for image related element
|
|
|
|
* - T365764 special treatment of inverted OOUI icons
|
2024-06-03 18:30:02 +00:00
|
|
|
*/
|
2024-06-04 17:47:15 +00:00
|
|
|
html.skin-theme-clientpref-night .skin-invert-image img,
|
2024-06-03 18:30:02 +00:00
|
|
|
html.skin-theme-clientpref-night .skin-invert,
|
2024-06-13 15:16:32 +00:00
|
|
|
html.skin-theme-clientpref-night @{OOUIIconSelectors},
|
|
|
|
html.skin-theme-clientpref-night @{OOUIIndicatorSelectors} {
|
2024-03-06 22:12:45 +00:00
|
|
|
color-scheme: light;
|
|
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
2023-09-22 17:50:07 +00:00
|
|
|
}
|
2024-02-13 22:14:42 +00:00
|
|
|
|
2024-06-14 15:32:18 +00:00
|
|
|
/**
|
|
|
|
* Forced light mode.
|
|
|
|
* Makes elements appear in light-mode when dark-mode is enabled.
|
|
|
|
* NOTE: might be used in templates and user generated content.
|
|
|
|
*/
|
2024-05-13 18:34:20 +00:00
|
|
|
html.skin-theme-clientpref-night .notheme,
|
2024-06-14 15:32:18 +00:00
|
|
|
html.skin-theme-clientpref-night @{OOUIOverrideSelectors} {
|
2024-03-06 22:12:45 +00:00
|
|
|
color-scheme: light;
|
|
|
|
color: var( --color-base );
|
2024-02-13 22:14:42 +00:00
|
|
|
}
|
|
|
|
|
2024-03-06 22:12:45 +00:00
|
|
|
/**
|
|
|
|
* Auto night mode.
|
|
|
|
*
|
|
|
|
* Applies the night mode color palette only in response to system settings.
|
|
|
|
*/
|
2024-02-13 22:14:42 +00:00
|
|
|
@media ( prefers-color-scheme: dark ) {
|
2024-03-20 18:13:14 +00:00
|
|
|
html.skin-theme-clientpref-os {
|
2024-03-06 22:12:45 +00:00
|
|
|
color-scheme: light dark;
|
|
|
|
.cdx-mode-dark();
|
2024-02-13 22:14:42 +00:00
|
|
|
}
|
2024-03-06 22:12:45 +00:00
|
|
|
|
2024-05-13 18:34:20 +00:00
|
|
|
html.skin-theme-clientpref-os .notheme,
|
2024-06-14 15:32:18 +00:00
|
|
|
html.skin-theme-clientpref-os @{OOUIOverrideSelectors} {
|
2024-03-06 22:12:45 +00:00
|
|
|
color-scheme: light;
|
|
|
|
}
|
|
|
|
|
2024-06-04 17:47:15 +00:00
|
|
|
// T365102 invert class specifically for image related elements
|
|
|
|
html.skin-theme-clientpref-os .skin-invert-image img,
|
2024-06-03 18:30:02 +00:00
|
|
|
html.skin-theme-clientpref-os .skin-invert,
|
2024-06-13 15:16:32 +00:00
|
|
|
html.skin-theme-clientpref-os @{OOUIIconSelectors},
|
|
|
|
html.skin-theme-clientpref-os @{OOUIIndicatorSelectors} {
|
2024-03-06 22:12:45 +00:00
|
|
|
color-scheme: light;
|
|
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-03 18:30:02 +00:00
|
|
|
/**
|
|
|
|
* Prevent double inversion.
|
|
|
|
* 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
|
|
|
|
* - OOUI icons inside .notheme OOUI elements
|
|
|
|
* - OOUI icons inside elements with .skin-invert
|
|
|
|
* - OOUI icons inside elements with .notheme
|
|
|
|
*/
|
2024-06-13 15:16:32 +00:00
|
|
|
@{OOUIOverrideSelectors},
|
|
|
|
.skin-invert,
|
|
|
|
.notheme {
|
|
|
|
@{OOUIIndicatorSelectors},
|
|
|
|
@{OOUIIconSelectors} {
|
|
|
|
filter: none !important; /* stylelint-disable-line declaration-no-important */
|
|
|
|
}
|
2024-06-03 18:30:02 +00:00
|
|
|
}
|
|
|
|
|
2024-03-06 22:12:45 +00:00
|
|
|
/**
|
|
|
|
* Font size settings
|
|
|
|
*/
|
2024-05-21 20:00:14 +00:00
|
|
|
.vector-feature-custom-font-size-clientpref--excluded,
|
2024-03-06 22:12:45 +00:00
|
|
|
.vector-feature-custom-font-size-clientpref-0 {
|
|
|
|
--font-size-medium: @font-size-small;
|
|
|
|
--line-height-medium: @line-height-small;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-feature-custom-font-size-clientpref-1 {
|
|
|
|
--font-size-medium: @font-size-medium;
|
|
|
|
--line-height-medium: @line-height-medium;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-feature-custom-font-size-clientpref-2 {
|
|
|
|
--font-size-medium: @font-size-x-large;
|
|
|
|
--line-height-medium: 1.5;
|
2024-02-13 22:14:42 +00:00
|
|
|
}
|