72126f3e8489ee4dca611a9aee66350c813630b6
[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 /*csslint regex-selectors:false */
6
7 /*
8 * Auto-numbered external links
9 * Parsoid renders those as link without content, and lets CSS do the
10 * counting. This way the counting style can be customized, and counts update
11 * automatically when content is modified.
12 */
13 .mw-body-content {
14 counter-reset: mw-NumberedExtLink;
15 }
16
17 .mw-body-content a[rel~="mw:ExtLink"]:empty:after {
18 content: "[" counter( mw-NumberedExtLink ) "]";
19 counter-increment: mw-NumberedExtLink;
20 }
21
22 /**
23 * References
24 *
25 * Parser and Extension:Cite output reference numbers for <sup>[1]</sup> for <ref> tags.
26 *
27 * Markup:
28 * Cake is good<sup>[2]</sup>
29 * The cake is a lie<span class="reference">[1]</span>
30 *
31 * Styleguide 1.1.
32 */
33 span.reference {
34 font-size: 80%;
35 line-height: 1;
36 vertical-align: super;
37 unicode-bidi: -moz-isolate;
38 unicode-bidi: isolate;
39 }
40
41 sup, sub {
42 line-height: 1;
43 }
44
45 /**
46 * Block media items
47 */
48 figure[typeof*='mw:Image'] {
49 margin: 0;
50
51 a {
52 border: 0;
53 }
54
55 &.mw-halign-right {
56 /* @noflip */
57 margin: 0.5em 0 1.3em 1.4em;
58 /* @noflip */
59 clear: right;
60 /* @noflip */
61 float: right;
62 }
63
64 &.mw-halign-left {
65 /* @noflip */
66 margin: 0.5em 1.4em 1.3em 0;
67 /* @noflip */
68 clear: left;
69 /* @noflip */
70 float: left;
71 }
72
73 &.mw-halign-none {
74 margin: 0;
75 clear: none;
76 float: none;
77 }
78
79 &.mw-halign-center {
80 margin: 0 auto 0.5em auto;
81 display: table;
82 clear: none;
83 float: none;
84 }
85
86 > figcaption {
87 display: table-caption;
88 caption-side: bottom;
89 /* In mw-core the font-size is duplicated, 94% in thumbiner
90 and again 94% in thumbcaption. 88% for font size of the
91 caption results in the same behavior. */
92 font-size: 88%;
93 line-height: 1.4em;
94 text-align: left;
95
96 border: 1px solid #ccc;
97 border-top: 0;
98
99 /* taken from .thumbcaption, plus .thumbinner */
100 padding: 1px 5px 5px;
101 background-color: #f9f9f9;
102
103 table {
104 /* reset caption side for tables inside figcaptions */
105 caption-side: top;
106 }
107 }
108 }
109
110 figure[typeof~='mw:Image/Thumb'],
111 figure[typeof~='mw:Image/Frame'] {
112 display: table;
113 overflow: auto;
114 text-align: center;
115 border: 1px solid #ccc;
116 border-bottom: 0; // No border to caption
117 border-collapse: collapse;
118 background-color: #f9f9f9;
119 // Default to right alignment. This is needed since Parsoid only specifies the
120 // alignment class when the alignment is explicitly set.
121 margin: 0.5em 0 1.3em 1.4em;
122 clear: right;
123 float: right;
124 }
125
126 figure[typeof~='mw:Image/Thumb'] > *:first-child > img,
127 figure[typeof~='mw:Image/Frame'] > *:first-child > img,
128 .mw-image-border > *:first-child > img {
129 border: 1px solid #ccc;
130 margin: 3px;
131 }
132
133 /* Hide the caption for frameless and plain floated images */
134 figure[typeof~="mw:Image/Frameless"] > figcaption,
135 figure[typeof~="mw:Image"] > figcaption {
136 display: none;
137 }