From: kaldari Date: Fri, 6 Jun 2014 21:11:48 +0000 (-0700) Subject: Make sure images that don't have an explicit alignment get aligned right X-Git-Tag: 1.31.0-rc.0~15450^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=99f093ad2f3552a193409c8ac37e196d47f33bc1;p=lhc%2Fweb%2Fwiklou.git Make sure images that don't have an explicit alignment get aligned right If the alignment of an image is not explicitly set, Parsoid does not output an alignment class for the resultant figure element. This can lead to the image not being aligned/floated. To fix this we modify content.parsoid.less to apply the default right-alignment styling to all images and then override this in cases where the alignment is explicitly set. Bug: 66282 Change-Id: I4f986f23b0c8ba6f6b66efc07eb38806744123e2 --- diff --git a/resources/src/mediawiki.skinning/content.parsoid.less b/resources/src/mediawiki.skinning/content.parsoid.less index 081524a44b..a9f0ab4d87 100644 --- a/resources/src/mediawiki.skinning/content.parsoid.less +++ b/resources/src/mediawiki.skinning/content.parsoid.less @@ -48,8 +48,9 @@ figure[typeof*='mw:Image'] { } &.mw-halign-center { - margin-left: auto; - margin-right: auto; + margin: 0 auto .5em auto; + clear: none; + float: none; } figcaption { @@ -75,6 +76,11 @@ figure[typeof~='mw:Image/Frame'] { padding: 3px; border: 1px solid #ccc; background-color: #f9f9f9; + // Default to right alignment. This is needed since Parsoid only specifies the + // alignment class when the alignment is explicitly set. + margin: .5em 0 1.3em 1.4em; + clear: right; + float: right; } figure[typeof~='mw:Image/Thumb'] img,