Merge "Remove MinervaKnownTemplateHacks"

This commit is contained in:
jenkins-bot 2024-04-25 19:25:36 +00:00 committed by Gerrit Code Review
commit a90cdd6cd8
9 changed files with 0 additions and 303 deletions

View file

@ -48,13 +48,6 @@ See <https://www.mediawiki.org/wiki/Manual:$wgSiteNotice>.
```
Controls whether the category button should be displayed.
#### $wgMinervaApplyKnownTemplateHacks
* Type: `Boolean`
* Default: `false`
When enabled and hacks.less exists, hacks.less workarounds are included in stylesheet. These should only be needed for Wikimedia based wikis or wikis using common templates such as Template:Infobox on those wikis.
#### $wgMinervaDonateLink
* Type: `Array`

View file

@ -32,10 +32,6 @@ class ResourceLoaderSkinModule extends ResourceLoader\SkinModule {
*/
protected function getLessVars( ResourceLoader\Context $context ) {
$lessVars = parent::getLessVars( $context );
$lessVars += [
'wgMinervaApplyKnownTemplateHacks' =>
$this->getConfig()->get( 'MinervaApplyKnownTemplateHacks' ),
];
return $lessVars;
}
}

View file

@ -1,238 +0,0 @@
/*
A file for css that corrects known rendering issues on known Wikimedia wikis.
the following definitions exist to deal with certain inline styles
present in wikitext.
This selectors used here should reflect the list on:
https://www.mediawiki.org/wiki/Recommendations_for_mobile_friendly_articles_on_Wikimedia_wikis#Use_standardized_class_names_in_HTML_markup_for_components_in_templates_across_projects
FIXME: Review all of these hacks to see if they still apply.
*/
@import '../../../minerva.less/minerva.variables.less';
@import '../../../minerva.less/minerva.mixins.less';
@import 'templates/ambox.less';
.content {
.vertical-navbox,
.navbox {
display: none;
}
table,
.infobox {
// Unfloat tables and infoboxes:;
// A lot of templates introduce floating and horizontal margins inline styles
float: none !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.infobox {
font-size: 90%;
position: relative;
border: @border-width-base @border-style-base var( --border-color-muted );
margin-bottom: 2em;
color: var( --color-base );
background-color: var( --background-color-interactive-subtle );
display: flex;
flex: 1 1 100%;
flex-flow: column nowrap;
width: 100% !important;
max-width: 100% !important;
caption {
padding: 10px 10px 0;
text-align: center;
}
th, td {
vertical-align: top;
border: 0;
border-bottom: @border-width-base @border-style-base var( --border-color-muted );
padding: 7px 10px;
}
tbody > tr > td,
tbody > tr > th {
flex: 1 0;
}
td:only-child,
th:only-child {
width: 100%;
}
tr:last-child th,
tr:last-child td {
border: 0;
}
& > tbody,
& > caption {
display: flex;
flex-flow: column nowrap;
}
& > tbody > tr {
min-width: 100%;
display: flex;
flex-flow: row nowrap;
}
}
// Hack to assign info boxes properly when using RTL languages on LTR wiki
.mw-content-ltr .infobox {
/* @noflip */
text-align: left;
}
// Hack to assign info boxes properly when using LTR languages on RTL wiki
.mw-content-rtl .infobox {
/* @noflip */
text-align: right;
}
}
.hatnote,
.dablink,
.rellink {
padding: 5px 7px;
color: var( --color-subtle );
font-size: @font-size-minerva-smallest;
background-color: var( --background-color-interactive-subtle );
margin-bottom: 1px;
overflow: hidden;
a {
color: var( --color-progressive );
}
}
@media all and ( min-width: @width-breakpoint-tablet ) {
// When in the HTML these should be revealed at tablet resolution (T172078)
.content {
.vertical-navbox,
.navbox {
display: inherit;
}
}
}
// Hacks to render galleries and multicol tables better on mobile
@media all and ( max-width: @width-breakpoint-tablet ) {
.content {
// Deal with Template:Multiple_image. T38030 and T148505
.thumb .thumbinner {
.flex-display( flex );
justify-content: center;
flex-wrap: wrap;
align-content: flex-start;
// avoid image child overflowing the container (T200518)
// stylelint-disable-next-line declaration-block-no-redundant-longhand-properties
flex-direction: column;
> .thumbcaption {
.flex( 1, 0, 100% );
display: block;
}
}
}
}
/* T358385 */
[ bgcolor ] {
// Important: this should correspond with the light mode theme version of color-base
color: #333;
}
html.skin-theme-clientpref-night {
// These colors become !important in night mode to avoid color contrast issues.
.hatnote:not( .notheme ),
.dablink:not( .notheme ),
.rellink:not( .notheme ),
.infobox:not( .notheme ) {
color: var( --color-base ) !important;
background-color: var( --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
// stylelint-disable no-descending-specificity
.infobox td,
.infobox th,
.infobox-above,
/* itwiki */.sinottico th,
.infobox-header,
/* T358164 General case that templates/extensions can opt into */
.skin-nightmode-reset-color,
.navigation-box,
.metadata,
/* T357735 */
.quotebox,
/* T357726 */
.side-box,
.side-box div,
/* T358012 */
.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
.mw-parser-output [ style*='background' ] {
color: #333; // not !important so that if a color is also specified it will take priority
}
}
@media ( prefers-color-scheme: dark ) {
html.skin-theme-clientpref-os {
/* T357453 */
.infobox td,
.infobox th,
.infobox-above,
/* itwiki */.sinottico th,
.infobox-header,
/* T358164 General case that templates/extensions can opt into */
.skin-nightmode-reset-color,
.navigation-box,
.metadata,
/* T357735 */
.quotebox,
/* T357726 */
.side-box,
.side-box div,
/* T358012 */
.navbox,
.navbox-subgroup,
.navbox-group,
.navbox-even,
.navbox-abovebelow,
.navbox-title {
&:not( .notheme ) {
.night-mode-strip-all-colors-when-safe();
}
}
// These colors become !important in night mode to avoid color contrast issues.
.hatnote:not( .notheme ),
.dablink:not( .notheme ),
.rellink:not( .notheme ),
.infobox:not( .notheme ) {
color: var( --color-base ) !important;
background-color: var( --background-color-interactive-subtle ) !important;
}
// T358797 - if a background color is specified, assume they wanted the day mode font color
.mw-parser-output [ style*='background' ] {
color: #333; // not !important so that if a color is also specified it will take priority
}
}
}
// stylelint-enable no-descending-specificity

View file

@ -6,6 +6,3 @@
@import 'links.less';
@import 'text.less';
@import 'tables.less';
& when (@wgMinervaApplyKnownTemplateHacks = 1) {
@import (multiple) 'hacks.less';
}

View file

@ -1,28 +0,0 @@
/*
A file for css that corrects known rendering issues on known Wikimedia wikis ON TABLETS
Many of them correct hacks in place in common/hacks.less
It will become redundant when the following RFC is resolved:
https://www.mediawiki.org/wiki/Requests_for_comment/Allow_styling_in_templates
FIXME: Review all of these hacks to see if they still apply.
*/
@import '../../../../minerva.less/minerva.variables.less';
@import '../../../../minerva.less/minerva.mixins.less';
/* Tablet specific styling */
@media all and ( min-width: @width-breakpoint-tablet ) {
.content {
// Float infoboxes to the right of the page
.infobox {
margin: 0.5em 0 1em 35px !important;
// Note this is fixed to ensure that we leave enough space for the sections to the infoboxes left
// FIXME [Templates]: Inline styles force us to use !important
max-width: @width-infobox !important;
width: auto !important;
float: right !important;
clear: right !important;
}
}
}

View file

@ -1,4 +1 @@
@import 'common.less';
& when (@wgMinervaApplyKnownTemplateHacks = 1) {
@import (multiple) 'hacks.less';
}

View file

@ -18,8 +18,4 @@
}
}
& when (@wgMinervaApplyKnownTemplateHacks = 1) {
@import 'hacks.less';
}
// stylelint-enable selector-max-id

View file

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

View file

@ -38,9 +38,6 @@
"MinervaEnableSiteNotice": {
"value": true
},
"MinervaApplyKnownTemplateHacks": {
"value": true
},
"MinervaAlwaysShowLanguageButton": {
"value": true
},