Make sure images that don't have an explicit alignment get aligned right
[lhc/web/wiklou.git] / resources / src / mediawiki.skinning / content.parsoid.less
1 /**
2 * Style Parsoid HTML+RDFa output consistent with wikitext from PHP parser.
3 */
4
5 /**
6 * References
7 *
8 * Parser and Extension:Cite output reference numbers for <sup>[1]</sup> for <ref> tags.
9 *
10 * Markup:
11 * Cake is good<sup>[2]</sup>
12 * The cake is a lie<span class="reference">[1]</span>
13 *
14 * Styleguide 1.1.
15 */
16 span.reference {
17 font-size: smaller;
18 line-height: normal;
19 vertical-align: super;
20 }
21
22 /**
23 * Block media items
24 */
25 figure[typeof*='mw:Image'] {
26 margin: 0;
27
28 a {
29 border: 0;
30 }
31
32 &.mw-halign-right {
33 /* @noflip */
34 margin: .5em 0 1.3em 1.4em;
35 /* @noflip */
36 clear: right;
37 /* @noflip */
38 float: right;
39 }
40
41 &.mw-halign-left {
42 /* @noflip */
43 margin: .5em 1.4em 1.3em 0;
44 /* @noflip */
45 clear: left;
46 /* @noflip */
47 float: left;
48 }
49
50 &.mw-halign-center {
51 margin: 0 auto .5em auto;
52 clear: none;
53 float: none;
54 }
55
56 figcaption {
57 display: table-caption;
58 caption-side: bottom;
59 /* In mw-core the font-size is duplicated, 94% in thumbiner
60 and again 94% in thumbcaption. 88% for font size of the
61 caption results in the same behavior. */
62 font-size: 88%;
63 line-height: 1.4em;
64 text-align: left;
65
66 /* taken from .thumbcaption */
67 padding: 3px;
68 }
69 }
70
71 figure[typeof~='mw:Image/Thumb'],
72 figure[typeof~='mw:Image/Frame'] {
73 display: table;
74 overflow: hidden;
75 text-align: center;
76 padding: 3px;
77 border: 1px solid #ccc;
78 background-color: #f9f9f9;
79 // Default to right alignment. This is needed since Parsoid only specifies the
80 // alignment class when the alignment is explicitly set.
81 margin: .5em 0 1.3em 1.4em;
82 clear: right;
83 float: right;
84 }
85
86 figure[typeof~='mw:Image/Thumb'] img,
87 .mw-image-border img {
88 border: 1px solid #cccccc;
89 }