diff --git a/resources/libraries/common-print.less b/resources/libraries/common-print.less new file mode 100644 index 0000000..b43387f --- /dev/null +++ b/resources/libraries/common-print.less @@ -0,0 +1,287 @@ +/** + * Fork of the MediaWiki 1.34 print style sheet + * Governs common content objects. + */ + +/* stylelint-disable selector-class-pattern */ + +@content-background: #fff; +@text: #000; +@block-background: #f9f9f9; +@block-border: #aaa; + +/** + * Hide all the elements irrelevant for printing + */ +/* General hide-in-print class, please only use sparely */ +.noprint, +/* Various content classes, in alphabetical order */ +.catlinks, +.magnify, +.mw-cite-backlink, +.mw-editsection, +.mw-editsection-like, +.mw-hidden-catlinks, +.mw-indicators, +.mw-redirectedfrom, +.patrollink, +.usermessage, +/* Various content ids, in alphabetical order */ +#siteNotice, +#siteSub { + display: none; +} + +/** + * Generic HTML elements + */ +body { + background: @content-background; + color: @text; + margin: 0; + padding: 0; +} + +/* Links */ +a { + background: none !important; /* stylelint-disable-line declaration-no-important */ + padding: 0 !important; /* stylelint-disable-line declaration-no-important */ +} + +a, +a.external, +a.new, +a.stub { + color: inherit !important; /* stylelint-disable-line declaration-no-important */ + text-decoration: inherit !important; /* stylelint-disable-line declaration-no-important */ +} + +dt { + font-weight: bold; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: bold; + margin: 2em 0 0.5em; + /* Pagination */ + page-break-after: avoid; + page-break-before: avoid; +} + +.firstHeading { + margin-top: 0; +} + +p { + margin: 1em 0; + line-height: 1.2; + /* Pagination */ + orphans: 3; + widows: 3; +} + +img, +figure, +.wikitable, +.thumb { + /* Pagination */ + page-break-inside: avoid; +} + +img { + border: 0; + vertical-align: middle; +} + +pre, +.mw-code { + background: @block-background; + color: @text; + border: 1pt dashed @block-border; + padding: 1em; + font-size: 8pt; + white-space: pre-wrap; + word-wrap: break-word; +} + +/* Prevent citations and subscripts from interfering with the line-height */ +sup, +sub { + line-height: 1; +} + +ul { + list-style-type: disc; +} + +/** + * MediaWiki-specific elements + */ + +.toc { + border: 1pt solid @block-border; + padding: 5px 5px 7px; + display: table; + background: @block-background; + + ul { + list-style: none; + + a { + display: block; + padding: 0.125em 0 !important; /* stylelint-disable-line declaration-no-important */ + } + } + + & > ul { + margin: 0; + padding-left: 0; + } + + h2 { + margin-top: 0; + } +} + +/* @noflip */ +.mw-content-ltr .tocnumber { + padding-left: 0; + padding-right: 0.5em; +} + +/* @noflip */ +.mw-content-rtl .tocnumber { + padding-left: 0.5em; + padding-right: 0; +} + +/** + * Floating divs (and thumbnails) + */ +/* @noflip */ +table.floatright, +div.floatright, +div.tright { + float: right; + clear: right; + position: relative; +} + +/* @noflip */ +table.floatleft, +div.floatleft, +div.tleft { + float: left; + clear: left; + position: relative; +} + +/* @noflip */ +div.tleft { + margin: 0.5em 1.4em 1.3em 0; +} + +/* @noflip */ +div.tright { + margin: 0.5em 0 1.3em 1.4em; +} + +/* @noflip */ +table.floatright, +div.floatright { + margin: 0 0 0.5em 0.5em; + border: 0; +} + +/* @noflip */ +table.floatleft, +div.floatleft { + margin: 0 0.5em 0.5em 0; + border: 0; +} + +.center { + text-align: center; +} + +/** + * Thumbnails + */ +div.thumb { + background-color: transparent; + width: auto; + border: solid 1pt @block-border; +} + +div.thumb a { + border-bottom: 0; +} + +div.thumbinner { + background: @block-background; + padding: 5px; + font-size: 10pt; + overflow: hidden; + min-width: 100px; +} + +html .thumbcaption { + text-align: left; + line-height: 1.4; + padding: 3px; +} + +img.thumbborder { + border: 1pt solid @block-border; +} + +/** + * Table rendering + */ +/* Compare `.wikitable` in shared.css */ +.wikitable, +.mw_metadata { + background: @content-background; + margin: 1em 0; + border: 1pt solid @block-border; + border-collapse: collapse; + font-size: 10pt; +} + +.wikitable > caption, +.mw_metadata caption { + padding: 5px; + font-size: 10pt; +} + +.wikitable > tr > th, +.wikitable > tr > td, +.wikitable > * > tr > th, +.wikitable > * > tr > td, +.mw_metadata th, +.mw_metadata td { + /* Important is required to override any inline styles provided by editors */ + background: @content-background !important; /* stylelint-disable-line declaration-no-important */ + /* We need to also set color in case editors applied a light text color */ + color: @text !important; /* stylelint-disable-line declaration-no-important */ + border: 1pt solid @block-border; + padding: 0.4em 0.6em; +} + +.wikitable > tr > th, +.wikitable > * > tr > th, +.mw_metadata th { + text-align: center; + background: #eee !important; /* stylelint-disable-line declaration-no-important */ +} + +table.listing, +table.listing td { + border: 1pt solid @block-border; + border-collapse: collapse; +} diff --git a/resources/libraries/shared.css b/resources/libraries/shared.css new file mode 100644 index 0000000..e234750 --- /dev/null +++ b/resources/libraries/shared.css @@ -0,0 +1,542 @@ +/** + * Yoinked from mw 1.34, because everything is all features in 1.35, and + * most of the features are styled for monobook specifically in 1.36+. + * + * Remove this file if that ever gets fixed? + */ + +/* stylelint-disable selector-class-pattern */ + +/* GENERAL CLASSES FOR DIRECTIONALITY SUPPORT */ + +/** + * These classes should be used for text depending on the content direction. + * Content stuff like editsection, ul/ol and TOC depend on this. + */ +.mw-content-ltr { + /* @noflip */ + direction: ltr; +} + +.mw-content-rtl { + /* @noflip */ + direction: rtl; +} + +/* Most input fields should be in site direction */ +.sitedir-ltr textarea, +.sitedir-ltr input { + /* @noflip */ + direction: ltr; +} + +.sitedir-rtl textarea, +.sitedir-rtl input { + /* @noflip */ + direction: rtl; +} + +.mw-userlink { + unicode-bidi: embed; +} + +/* User-Agent styles for new HTML5 elements */ +mark { + background-color: #ff0; + color: #000; +} + +/* Helper for wbr element on IE 8+; in HTML5, but not supported by default as of IE 11. */ +/* Note canonical HTML5 styles recommend "content: \u200B", but this doesn't work as of IE 11. */ +wbr { + display: inline-block; +} + +/* Input types that should follow user direction, like buttons */ +/* TODO: What about buttons in wikipage content ? */ +input[ type='submit' ], +input[ type='button' ], +input[ type='reset' ], +input[ type='file' ] { + direction: ltr; +} + +/* Override default values */ +textarea[ dir='ltr' ], +input[ dir='ltr' ] { + /* @noflip */ + direction: ltr; +} + +textarea[ dir='rtl' ], +input[ dir='rtl' ] { + /* @noflip */ + direction: rtl; +} + +/* Default style for semantic tags */ +abbr[ title ], +.explain[ title ] { + border-bottom: 1px dotted; + cursor: help; +} + +@supports ( text-decoration: underline dotted ) { + abbr[ title ], + .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; +} + +/** + * Patrol stuff + */ +.not-patrolled { + background-color: #ffa; +} + +.unpatrolled { + font-weight: bold; + color: #d33; +} + +div.patrollink { + font-size: 75%; + text-align: right; +} + +/** + * 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; +} + +/** + * Image captions. + * + * This is only meant to provide the most basic of styles, visual settings shouldn't be added here. + */ + +/* @noflip */ +.mw-content-ltr .thumbcaption { + text-align: left; +} + +/* @noflip */ +.mw-content-ltr .magnify { + float: right; +} + +/* @noflip */ +.mw-content-rtl .thumbcaption { + text-align: right; +} + +/* @noflip */ +.mw-content-rtl .magnify { + float: left; +} + +/** + * Categories + */ +#catlinks { + /** + * Overrides text justification (user preference) + * See T33990 + */ + text-align: left; +} + +.catlinks ul { + display: inline; + margin: 0; + padding: 0; + list-style: none none; +} + +.catlinks li { + display: inline-block; + line-height: 1.25em; + border-left: 1px solid #a2a9b1; + margin: 0.125em 0; + padding: 0 0.5em; + zoom: 1; +} + +.catlinks li:first-child { + padding-left: 0.25em; + border-left: 0; +} + +/* (T7346) make category redirects italic */ +.catlinks li a.mw-redirect { + font-style: italic; +} + +/** + * Hidden categories + */ +.mw-hidden-cats-hidden { + display: none; +} + +.catlinks-allhidden { + display: none; +} + +/** + * 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; +} + +/** + * Recreating deleted page warning + * Reupload file warning + * Page protection warning + * incl. log entries for these warnings + */ +div.mw-warning-with-logexcerpt { + padding: 3px; + margin-bottom: 3px; + border: 2px solid #2a4b8d; + clear: both; +} + +div.mw-warning-with-logexcerpt ul li { + font-size: 90%; +} + +/* (show/hide) revision deletion links */ +span.mw-revdelundel-link, +strong.mw-revdelundel-link { + font-size: 90%; +} + +span.mw-revdelundel-hidden, +input.mw-revdelundel-hidden { + visibility: hidden; +} + +td.mw-revdel-checkbox, +th.mw-revdel-checkbox { + padding-right: 10px; + text-align: center; +} + +/* 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; +} + +/** + * wikitable class for skinning normal tables + * keep in sync with commonPrint.css + */ +.wikitable { + background-color: #f8f9fa; + color: #222; + margin: 1em 0; + border: 1px solid #a2a9b1; + border-collapse: collapse; +} + +.wikitable > tr > th, +.wikitable > tr > td, +.wikitable > * > tr > th, +.wikitable > * > tr > td { + border: 1px solid #a2a9b1; + padding: 0.2em 0.4em; +} + +.wikitable > tr > th, +.wikitable > * > tr > th { + background-color: #eaecf0; + text-align: center; +} + +.wikitable > caption { + font-weight: bold; +} + +/* Error, warning, success and neutral messages */ +.error, +.warning, +.success { + font-size: larger; +} + +.error { + color: #d33; +} + +.warning { + color: #ac6600; +} + +.success { + color: #14866d; +} + +.messagebox, +.errorbox, +.warningbox, +.successbox { + color: #000; + margin-bottom: 1em; + border: 1px solid; + padding: 0.5em 1em; +} + +.messagebox h2, +.errorbox h2, +.warningbox h2, +.successbox h2 { + color: inherit; + display: inline; + margin: 0 0.5em 0 0; + border: 0; + font-size: 1em; + font-weight: bold; +} + +.messagebox { + background-color: #eaecf0; + border-color: #a2a9b1; +} + +.errorbox { + background-color: #fee7e6; + border-color: #d33; +} + +.warningbox { + background-color: #fef6e7; + border-color: #fc3; +} + +.successbox { + background-color: #d5fdf4; + border-color: #14866d; +} + +/* general info/warning box for SP */ +.mw-infobox { + border: 2px solid #fc3; + margin: 0.5em; + clear: left; + overflow: hidden; +} + +.mw-infobox-left { + margin: 7px; + float: left; + width: 35px; +} + +.mw-infobox-right { + margin: 0.5em 0.5em 0.5em 49px; +} + +/* Note on preview page */ +.previewnote { + margin-bottom: 1em; +} + +.visualClear { + clear: both; +} + +/** + * Data table style + * + * Table with suddle borders + * and row-highlighting. + */ +.mw-datatable { + border: 1px solid #a2a9b1; + border-collapse: collapse; +} + +.mw-datatable td, +.mw-datatable th { + border: 1px solid #a2a9b1; + padding: 0.2em 0.4em; +} + +.mw-datatable th { + background-color: #eaeeff; +} + +.mw-datatable td { + background-color: #fff; +} + +.mw-datatable tr:hover td { + background-color: #eaf3ff; +} + +/* Images */ + +/* @noflip */ div.tright, +div.floatright, +table.floatright { + clear: right; + float: right; +} + +/* @noflip */ div.tleft, +div.floatleft, +table.floatleft { + float: left; + clear: left; +} + +div.floatright, +table.floatright, +div.floatleft, +table.floatleft { + position: relative; +} + +/* T14205 */ +#mw-credits a { + unicode-bidi: embed; +} + +/* Print footer should be hidden by default in screen. */ +.printfooter { + display: none; +} + +/* For developers */ +.xdebug-error { + position: absolute; + z-index: 99; +} + +.mw-editsection { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} + +/* Display editsection links smaller and next to headings */ +.mw-editsection, +.mw-editsection-like { + font-size: small; + font-weight: normal; + margin-left: 1em; + vertical-align: baseline; + /* Reset line-height; headings tend to have it set to larger values */ + line-height: 1em; +} + +/* Correct directionality when page dir is different from site/user dir */ +/* @noflip */ +.mw-content-ltr .mw-editsection, +.mw-content-rtl .mw-content-ltr .mw-editsection { + margin-left: 1em; +} + +/* @noflip */ +.mw-content-rtl .mw-editsection, +.mw-content-ltr .mw-content-rtl .mw-editsection { + margin-right: 1em; +} + +/* Prevent citations and subscripts from interfering with the line-height */ +sup, +sub { + line-height: 1; +} diff --git a/resources/print.css b/resources/print.css index 4f53824..9c76b74 100644 --- a/resources/print.css +++ b/resources/print.css @@ -1,13 +1,11 @@ /* Styles for print view and printing */ /* Hide some extra stuff from print view */ -.mw-indicators, #mw-header, #mw-site-navigation, #mw-related-navigation, #mw-page-header-links, -.mw-footer, -#catlinks { +#mw-footer { display: none; } diff --git a/resources/screen-common.less b/resources/screen-common.less index 223541e..311afca 100644 --- a/resources/screen-common.less +++ b/resources/screen-common.less @@ -411,10 +411,6 @@ a.mw-selflink { display: none; } -.visual-clear { - clear: both; -} - .mw-indicators { float: right; margin-left: 1em; @@ -696,6 +692,7 @@ ul { /* Tables of contents */ ul#filetoc, .toc, +.toccolours, .mw-warning { display: table; .box; @@ -703,6 +700,7 @@ ul#filetoc, margin-top: 1em; margin-bottom: 1em; min-width: 15em; + font-size: 100%; } .toc { @@ -730,6 +728,7 @@ ul#filetoc { .mw-body .toctitle { border-bottom: solid 2px @base70; + text-align: unset; h2 { font-size: 1em; diff --git a/skin.json b/skin.json index 69c1502..0fb1efd 100644 --- a/skin.json +++ b/skin.json @@ -56,14 +56,31 @@ ], "class": "TimelessVariablesModule", "features": { - "content-links": true, + "normalize": false, "logo": true, - "legacy": true + "content-thumbnails": false, + "content-media": false, + "content-links": true, + "content-links-external": true, + "content-parser-output": false, + "content-tables": false, + "interface": false, + "interface-category": false, + "interface-message-box": false, + "elements": false, + "legacy": false, + "i18n-ordered-lists": true, + "i18n-all-lists-margins": true, + "i18n-headings": true, + "toc": true }, "styles": { "resources/libraries/normalise.css": { "media": "screen" }, + "resources/libraries/shared.css": { + "media": "screen" + }, "resources/forms.less": { "media": "screen" }, @@ -86,6 +103,9 @@ "media": "screen and (max-width: 850px)" }, "0": "resources/screen-misc.less", + "resources/libraries/common-print.less": { + "media": "print" + }, "resources/print.css": { "media": "print" }