We should split the mediawiki.legacy.shared module into non-legacy manageable parts. It's over a thousand lines of CSS that is loaded on all pages and all skins. We can do better than that.
Doing that would hopefully allow us to only load some parts when they are actually used, or allow skins to override the styles using [[https://www.mediawiki.org/w/index.php?title=Manual:$wgResourceModuleSkinStyles|$wgResourceModuleSkinStyles]].
Vaguely related:
* T56796#621744
* T62360#1050777
# Goal
- [ ] The ResourceLoaderSkinModule will throw a deprecation message when the `legacy` module is requested inside the constructor, with directions on which modules to use instead.
htps://github.com/wikimedia/mediawiki/blob/master/includes/resourceloader/ResourceLoaderSkinModule.php#L160
- [ ] The `legacy` feature will no longer be a default and instead we will set sensible defaults from the new ResourceLoaderSkinModule features.
The defaults must include: `normalize`, `i18n-ordered-lists`, `interface`, `interface-message-boxes`
The defaults may include: `i18n-all-lists-margins`, `i18n-headings`
3) The https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki.skinning/legacy.less file will be deprecated and removed
# Remaining work
As of November 17th, the legacy file contains
* Rules that are duplicated in the normalize feature e.g. `sub,sup {line-height: 1;}`
* Rules that are duplicated in the interface feature e.g. `.printfooter {display: none;}`
* True legacy rules. These include `#mw-credits a`, `xdebug-error`, `mw-ajax-loader`, `mw-small-spinner`, `visualClear`, `mw-infobox-left`, `mw-infobox-right` and `mw-infobox`. Extensions relying on these should be patched. If gadgets are using them we should move them to site/gadget styles.
# Remaining work
[] Review Linker styles. Confirm mw-revdelundel-hidden is unused and if mw-revdelundel-link is still necessary. If so can it be generalized?
[] mw-revdel-checkbox rules are only needed by SpecialRevisionDelete.php - make sure they are moved into a dedicated stylesheet for only that page.
[] wikitable rules are moved to a dedicated ResourceLoaderSkinModule feature.
[] Review `.error, .warning, .success` classes are no longer used in our code.
[] T232903: Deprecate Html::infobox (T268078) and make sure the styles relating to mw-infobox-left and mw-infobox-right are moved into the installer stylesheet.
[] Review the messagebox-like-styles `mw-warning-with-logexcerpt`, `#mw-clearyourcache, #mw-sitecsspreview, #mw-sitejspreview, #mw-usercsspreview, #mw-userjspreview`, `.previewnote`
[] Determine whether content floating rules (`.floatleft`) should become a `feature` of ResourceLoaderSkinModule or packaged only on pages that need them.
[] Styles for viewing an old revision should be moved to a stylesheet loaded only when needed rather than for all page views (`#mw-revision-info`)
[] Styles for table of contents should be moved into the existing `toc` feature.
[] The rules for `.mw-ajax-loader`, `.mw-small-spinner`
[] .mw-datatable rules are consolidated with resources/src/mediawiki.pager.tablePager/TablePager.less and resources/src/mediawiki.special/listFiles.less and removed from the ResourceLoaderSkinModule legacy file, so that they are only loaded when needed.
[] Create a feature for interface category links (note Minerva doesn't use these styles so they make sense as a separate feature) T278373
[] Review whether .mw-content-ltr and .mw-content-rtl direction rules are still applicable, and if so move them to content-i18n
[] Determine whether textarea and input direction rules are still applicable (including input[ type='submit' ]), and if so move them to the normalize stylesheet.
[] Determine whether the mark element is actually used in MediaWiki and if so move to normalize stylesheet.
[] Drop wbr element support (IE<11 support)
[] `.not-patrolled,div.patrollink, .unpatrolled,div.patrollink` styles should be moved to a stylesheet that is only shipped to patrollers. `mediawiki.misc-authed-curate ` might be appropriate depending on whether needs to be render blocking.
[] T269877: Drop thumbnail direction styles in legacy
[] ..
[] Review below CSS and create new bullet points for remaining work above
```
/**
* These classes should be used for text depending on the content direction.
* Content stuff like editsection, ul/ol and TOC depend on this.
*/
.mw-userlink {
// Word-break overlong user names, see T237230.
// FIXME: This property is introduced now, but will be separated in a follow-up
// caring about 'i18n-directionality', see T247033.
.hyphens( auto );
unicode-bidi: embed;
}
/* User-Agent styles for new HTML5 elements */
mark {
background-color: #ff0;
color: #000;
}
/* Default style for semantic tags */
abbr[ title ], /* Note: Duplicate ruleset if skins load `normalize` and `legacy`. */
.explain[ title ] {
border-bottom: 1px dotted;
cursor: help;
}
@supports ( text-decoration: underline dotted ) {
abbr[ title ], /* FIXME: Remove similar to `abbr` above. */
.explain[ title ] {
border-bottom: 0;
text-decoration: underline dotted;
}
}
/* Comment portions of RC entries */
span.comment {
font-style: italic;
unicode-bidi: -moz-isolate;
unicode-bidi: isolate;
}
/* Stop floats from intruding into edit area in previews */
#editform,
#toolbar,
#wpTextbox1 {
clear: both;
}
/* Prevent editing textarea from jumping when toolbar is loaded */
#toolbar {
height: 22px;
}
/* Underline preference */
.mw-underline-always a {
text-decoration: underline;
}
.mw-underline-never a {
text-decoration: none;
}
/**
* rev_deleted stuff
*/
li span.deleted,
span.history-deleted {
text-decoration: line-through;
color: #72777d;
font-style: italic;
}
/**
* Forms
*/
td.mw-label {
text-align: right;
vertical-align: middle;
}
td.mw-input {
text-align: left;
}
td.mw-submit {
text-align: left;
white-space: nowrap;
}
.mw-input-with-label {
white-space: nowrap;
display: inline-block;
}
/**
* Convenience links to edit delete and protect reasons
*/
p.mw-protect-editreasons,
p.mw-filedelete-editreasons,
p.mw-delete-editreasons {
font-size: 90%;
text-align: right;
}
/* The auto-generated edit comments */
.autocomment,
.autocomment a,
.autocomment a:visited {
color: #72777d;
}
/** Generic minor/bot/newpage styling (recent changes) */
.newpage,
.minoredit,
.botedit {
font-weight: bold;
}
/* red links; see T38276 */
a.new {
color: #ba0000;
}
/* Plainlinks - this can be used to switch
* off special external link styling */
.plainlinks a.external {
background: none !important; /* stylelint-disable-line declaration-no-important */
padding: 0 !important; /* stylelint-disable-line declaration-no-important */
}
/* External URLs should always be treated as LTR (T6330) */
/* @noflip */ .rtl a.external.free,
.rtl a.external.autonumber {
direction: ltr;
unicode-bidi: embed;
}
```
# sign off steps
[] A task should be created about the removal of now deprecated styles e.g. .mw-infobox rules removed in T268194