Move Parsoid output overrides to 'mediawiki.skinning.content.parsoid' skinStyles

We need to load these only when VisualEditor is loaded. This is
the best way to ensure that. They have been haphazardly placed
in different files.

The goal of this change is to move content styling for Minerva out of
mobile.editor.ve/minerva.less, and thus to be able to move this file
to mediawiki/extensions/MobileFrontend (T202978). But I spotted the
other places while working on that.

Moved as-is:
* skins.minerva.content.styles/links.less
* mobile.editor.ve/minerva.less

No longer needed:
* skins.minerva.content.styles/text.less
  Parsoid now uses <sup> tags for references rather than <span>,
  so the existing rules for <sup> tags are enough. See T45094,
  <https://www.mediawiki.org/wiki/Specs/HTML/1.6.0/Extensions/Cite>.

Was never needed:
* skins.minerva.content.styles/thumbnails.less
  The styles from the core module 'mediawiki.skinning.content.parsoid'
  are never loaded, so we don't need to override them.

Bug: T202978
Change-Id: I45e1cb89b65a41a29d2b1a361a79199745ccec14
This commit is contained in:
Bartosz Dziewoński 2018-09-17 22:56:57 +02:00
parent 73d724a72f
commit 5e7b3994fd
6 changed files with 56 additions and 57 deletions

View file

@ -62,15 +62,3 @@ a {
background: none !important;
padding: 0 !important;
}
// Numbered external links, copied from content.parsoid.less
// TODO: Separate theme-agnostic rules from that module
// so we can load it here.
.mw-parser-output {
counter-reset: mw-numbered-ext-link;
a[ rel~='mw:ExtLink' ]:empty:after {
content: '[' counter( mw-numbered-ext-link ) ']';
counter-increment: mw-numbered-ext-link;
}
}

View file

@ -62,7 +62,6 @@ i {
font-style: italic;
}
.mw-ref, // For Parsoid content (e.g. mediawiki.skinning.content.parsoid)
sup {
vertical-align: super;
}
@ -71,7 +70,6 @@ sub {
vertical-align: sub;
}
.mw-ref, // For Parsoid content (e.g. mediawiki.skinning.content.parsoid)
sub,
sup {
font-size: 0.75em;

View file

@ -43,11 +43,7 @@
}
// Hide the image magnification icon normally displayed in image captions
.magnify,
// Parsoid version of magnification icon (T160960)
figure[ typeof*='mw:Image/Thumb' ] > a:after,
figure[ typeof*='mw:Video/Thumb' ] > a:after,
figure[ typeof*='mw:Audio/Thumb' ] > a:after {
.magnify {
display: none;
}
}

View file

@ -105,7 +105,9 @@
"mediawiki.special.search.styles": [
"skinStyles/mediawiki.special.search.styles/minerva.less"
],
"mediawiki.skinning.content.parsoid": [],
"mediawiki.skinning.content.parsoid": [
"skinStyles/mediawiki.skinning.content.parsoid/minerva.less"
],
"mediawiki.hlist": [
"skinStyles/mediawiki.hlist/minerva.less"
],

View file

@ -0,0 +1,52 @@
/**
* Style Parsoid HTML+RDFa output consistent with wikitext from PHP parser.
*/
/*
* Auto-numbered external links
* (copied from MediaWiki's content.parsoid.less)
*/
.mw-parser-output {
counter-reset: mw-numbered-ext-link;
a[ rel~='mw:ExtLink' ]:empty:after {
content: '[' counter( mw-numbered-ext-link ) ']';
counter-increment: mw-numbered-ext-link;
}
}
/**
* Block media items
* (mostly derived from MediaWiki's content.parsoid.less)
*/
figure[ typeof*='mw:Image' ],
figure[ typeof*='mw:Video' ],
figure[ typeof*='mw:Audio' ] {
max-width: 100%;
// Defaults to right alignment when not explicitly set. Should be flippable.
margin: 0.6em 0 0.6em 1.4em;
&.mw-halign-left {
/* @noflip */
margin: 0.6em 1.4em 0.6em 0;
/* @noflip */
clear: left;
/* @noflip */
float: left;
}
&.mw-halign-right {
/* @noflip */
margin: 0.6em 0 0.6em 1.4em;
/* @noflip */
clear: right;
/* @noflip */
float: right;
}
&.mw-halign-center {
margin: 0.6em auto 0.6em auto;
clear: none;
float: none;
}
}

View file

@ -8,43 +8,6 @@
h1, h2, h3, h4, h5 {
display: block;
}
// Styling for images (as output by Parsiod)
// These styles are mostly derived from content.parsoid.less, which the Minerva skin
// opts out of (since the styles are largely Vectorish).
// FIXME: Once Parser and Parsoid output are synchronized, we'll want to move these
// from here into the regular Minerva content styles.
figure[ typeof*='mw:Image' ],
figure[ typeof*='mw:Video' ],
figure[ typeof*='mw:Audio' ] {
max-width: 100%;
// Defaults to right alignment when not explicitly set. Should be flippable.
margin: 0.6em 0 0.6em 1.4em;
&.mw-halign-left {
/* @noflip */
margin: 0.6em 1.4em 0.6em 0;
/* @noflip */
clear: left;
/* @noflip */
float: left;
}
&.mw-halign-right {
/* @noflip */
margin: 0.6em 0 0.6em 1.4em;
/* @noflip */
clear: right;
/* @noflip */
float: right;
}
&.mw-halign-center {
margin: 0.6em auto 0.6em auto;
clear: none;
float: none;
}
}
}
.overlay-content {