Merge "Main page should work in night mode"

This commit is contained in:
jenkins-bot 2024-02-29 20:35:45 +00:00 committed by Gerrit Code Review
commit 07b25670af
4 changed files with 28 additions and 0 deletions

View file

@ -78,3 +78,12 @@
.night-mode-invert-image() {
filter: invert( 1 ) hue-rotate( 180deg );
}
/** This mixin should only be used where it's safe to do so. It should not be applied
to content which may have important information. */
.night-mode-strip-all-colors-when-safe() {
background: inherit !important;
color: inherit !important;
/* If a border is defined retain it but make it black. If no border this won't do anything. */
border-color: var( --border-color-subtle ) !important;
}

View file

@ -17,4 +17,9 @@
margin-top: 1em;
}
}
& when (@wgMinervaApplyKnownTemplateHacks = 1) {
@import 'hacks.less';
}
// stylelint-enable selector-max-id

View file

@ -0,0 +1,13 @@
.skin-night-mode-clientpref-1 .page-Main_Page {
.mw-parser-output :not( .notheme ) {
.night-mode-strip-all-colors-when-safe();
}
}
@media ( prefers-color-scheme: dark ) {
.skin-night-mode-clientpref-2 .page-Main_Page {
.mw-parser-output :not( .notheme ) {
.night-mode-strip-all-colors-when-safe();
}
}
}

View file

@ -388,6 +388,7 @@
]
},
"skins.minerva.mainPage.styles": {
"class": "MediaWiki\\Minerva\\ResourceLoaderSkinModule",
"styles": [
"resources/skins.minerva.mainPage.styles/common.less"
]