Page MenuHomePhabricator
Paste P62659

Dark-theme.less suggestions
ActivePublic

Authored by Izno on May 19 2024, 5:07 PM.
@import 'mediawiki.skin.variables.less';
@import 'mixins.less';
/* TODO: Check matches https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/master/resources/skins.minerva.base.styles/content/hacks.less#L188 onwards
before merging. */
/* What is this TODO still doing here? hacks.less no longer exists :) */
/* T358385 */
/* Suggest: Generic stays here */
[ bgcolor ] {
// Important: this should correspond with the light mode theme version of color-base
color: #333;
}
/* as an aside, consider removing `html`? Only conceivable reason to have this is performance? */
html.skin-theme-clientpref-night {
// These colors become !important in night mode to avoid color contrast issues.
.hatnote:not( .notheme ), /* Suggest: Move to dark-theme-hatnote.less */
.dablink:not( .notheme ), /* Suggest: Move to dark-theme-hatnote.less */
.rellink:not( .notheme ), /* Suggest: Move to dark-theme-hatnote.less */
/* Suggest: Move to dark-theme-infobox.less */
.infobox:not( .notheme ) {
color: @color-base !important;
background-color: @background-color-interactive-subtle !important;
}
/* T357453 - attempt to strip colors from the majority of infoboxes in night mode (unless notheme specified) */
// please forgive me for bypassing the linter there is no easy way to keep all of the infobox classes grouped without
/* Suggest: Move to dark-theme-infobox.less */
.infobox td,
.infobox th,
.infobox-above,
/* T359644 */
.infobox p,
.infobox > div,
.infobox caption,
/* frwiki T359644 */
/* Suggest: Kind of feel like the site specific infobox names should move onwiki? Putting them in dark-theme-infobox is also fine, selectors are cheap */
.infobox--frwiki td,
.infobox--frwiki th,
.infobox--frwiki p,
.infobox--frwiki > div,
.infobox--frwiki caption,
/* itwiki */
.sinottico th,
.infobox-header,
/* T358164 General case that templates/extensions can opt into */
.skin-nightmode-reset-color, /* Suggest: Generic stays here */
.navigation-box, /* Suggest: move to dark-theme-navbox.less (see also T358078#9811395 ) */
.metadata, /* Suggest: move to dark-theme-metadata.less (see also T365318 ) */
/* T357735 */
.quotebox, /* Suggest: move to dark-theme-quotes.less */
/* T357726 */
.side-box, /* Suggest: move to dark-theme-sidebox.less */
.side-box div,
/* T358012 */
/* Suggest: move to dark-theme-navbox.less */
.navbox,
.navbox-subgroup,
.navbox-group,
.navbox-even,
.navbox-abovebelow,
.navbox-title {
&:not( .notheme ) {
.night-mode-strip-all-colors-when-safe();
}
}
// T358797 - if a background color is specified, assume they wanted the day mode font color
/* Suggest: generic stays here */
.mw-parser-output [ style*='background' ] {
/* @color-base */
color: #202122; // not !important so that if a color is also specified it will take priority
}
}
@media ( prefers-color-scheme: dark ) {
html.skin-theme-clientpref-os {
/* Suggest: exercise to reader */
}
}