| 1 |
@import 'mediawiki.skin.variables.less'; |
| 2 |
@import 'mediawiki.skin.codex-design-tokens/theme-wikimedia-ui-mixin-dark.less'; |
| 3 |
@import 'mediawiki.skin.codex-design-tokens/theme-wikimedia-ui-reset.less'; |
| 4 |
|
| 5 |
/** |
| 6 |
* T365764 - OOUI Icon classes for inverted dark-mode icons. |
| 7 |
* This includes OOUI icons that are not colored (progressive/destructive), checkbox icons, and |
| 8 |
* indicator widgets. |
| 9 |
*/ |
| 10 |
@OOUIIconSelectors: ~'.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 )'; |
| 11 |
@OOUIIndicatorSelectors: ~'.oo-ui-indicatorElement-indicator'; |
| 12 |
|
| 13 |
@media screen { |
| 14 |
/** |
| 15 |
* Light mode |
| 16 |
* |
| 17 |
* Applies the light mode color palette by default |
| 18 |
* or with the .skin-invert, or .notheme classes |
| 19 |
*/ |
| 20 |
:root, |
| 21 |
.skin-invert, |
| 22 |
.notheme { |
| 23 |
.cdx-mode-reset(); |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Forced night mode. |
| 28 |
* |
| 29 |
* Applies the night mode color palette per the users explicit preference, |
| 30 |
* regardless of system settings. |
| 31 |
*/ |
| 32 |
html.skin-theme-clientpref-night { |
| 33 |
color-scheme: dark; |
| 34 |
.cdx-mode-dark(); |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Inverted Dark-mode |
| 39 |
* Creates a dark-mode effect on elements by flipping their color, |
| 40 |
* (usually from black to white). |
| 41 |
* Applied as a last resort when using CSS variables is not possible. |
| 42 |
* NOTE: `.skin-invert` is used in templates and user generated content. |
| 43 |
* |
| 44 |
* - T365102 invert class specifically for image related element |
| 45 |
* - T365764 special treatment of inverted OOUI icons |
| 46 |
*/ |
| 47 |
html.skin-theme-clientpref-night .skin-invert-image img, |
| 48 |
html.skin-theme-clientpref-night .skin-invert, |
| 49 |
html.skin-theme-clientpref-night @{OOUIIconSelectors}, |
| 50 |
html.skin-theme-clientpref-night @{OOUIIndicatorSelectors} { |
| 51 |
color-scheme: light; |
| 52 |
filter: invert( 1 ) hue-rotate( 180deg ); |
| 53 |
} |
| 54 |
|
| 55 |
/** |
| 56 |
* Forced light mode. |
| 57 |
* Makes elements appear in light-mode when dark-mode is enabled. |
| 58 |
* NOTE: might be used in templates and user generated content. |
| 59 |
*/ |
| 60 |
html.skin-theme-clientpref-night .notheme { |
| 61 |
color-scheme: light; |
| 62 |
color: var( --color-base ); |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* Prevent double inversion. |
| 67 |
* Do not apply invert to elements that are inside a notheme or a skin-invert class to avoid inversion in light theme or |
| 68 |
* double inversion in an already inverted element |
| 69 |
* - OOUI icons inside .notheme OOUI elements |
| 70 |
* - OOUI icons inside elements with .skin-invert |
| 71 |
* - OOUI icons inside elements with .notheme |
| 72 |
*/ |
| 73 |
.skin-invert, |
| 74 |
.notheme { |
| 75 |
@{OOUIIndicatorSelectors}, |
| 76 |
@{OOUIIconSelectors} { |
| 77 |
filter: none !important; /* stylelint-disable-line declaration-no-important */ |
| 78 |
} |
| 79 |
} |
| 80 |
|
| 81 |
/** |
| 82 |
* Font size settings |
| 83 |
*/ |
| 84 |
.vector-feature-custom-font-size-clientpref--excluded, |
| 85 |
.vector-feature-custom-font-size-clientpref-0 { |
| 86 |
--font-size-medium: @font-size-small; |
| 87 |
--line-height-medium: @line-height-small; |
| 88 |
} |
| 89 |
|
| 90 |
.vector-feature-custom-font-size-clientpref-1 { |
| 91 |
--font-size-medium: @font-size-medium; |
| 92 |
--line-height-medium: @line-height-medium; |
| 93 |
} |
| 94 |
|
| 95 |
.vector-feature-custom-font-size-clientpref-2 { |
| 96 |
--font-size-medium: @font-size-x-large; |
| 97 |
--line-height-medium: 1.5; |
| 98 |
} |
| 99 |
} |
| 100 |
|
| 101 |
/** |
| 102 |
* Auto night mode. |
| 103 |
* |
| 104 |
* Applies the night mode color palette only in response to system settings. |
| 105 |
*/ |
| 106 |
@media screen and ( prefers-color-scheme: dark ) { |
| 107 |
html.skin-theme-clientpref-os { |
| 108 |
color-scheme: light dark; |
| 109 |
.cdx-mode-dark(); |
| 110 |
} |
| 111 |
|
| 112 |
html.skin-theme-clientpref-os .notheme { |
| 113 |
color-scheme: light; |
| 114 |
color: var( --color-base ); |
| 115 |
} |
| 116 |
|
| 117 |
// T365102 invert class specifically for image related elements |
| 118 |
html.skin-theme-clientpref-os .skin-invert-image img, |
| 119 |
html.skin-theme-clientpref-os .skin-invert, |
| 120 |
html.skin-theme-clientpref-os @{OOUIIconSelectors}, |
| 121 |
html.skin-theme-clientpref-os @{OOUIIndicatorSelectors} { |
| 122 |
color-scheme: light; |
| 123 |
filter: invert( 1 ) hue-rotate( 180deg ); |
| 124 |
} |
| 125 |
} |