Debian Codegraph @

skins/Timeless/resources/content.media-common.less

raw
1 @import 'variables-content.less';
2
3 /**
4 * Block media items
5 */
6
7 figure[ typeof~='mw:File' ],
8 figure[ typeof~='mw:File/Frameless' ] {
9 margin: 0; // Maybe belongs in element.css for figure
10
11 > a {
12 // The addition of the class is needed for higher specificity
13 // than Vector's print styles
14 .mw-body-content & {
15 border: 0;
16 }
17 }
18
19 &.mw-halign-right {
20 /* @noflip */
21 margin: @margin-floatright;
22 /* @noflip */
23 clear: right;
24 /* @noflip */
25 float: right;
26 }
27
28 &.mw-halign-left {
29 /* @noflip */
30 margin: @margin-floatleft;
31 /* @noflip */
32 clear: left;
33 /* @noflip */
34 float: left;
35 }
36
37 &.mw-halign-none {
38 clear: none;
39 float: none;
40 }
41
42 &.mw-halign-center {
43 /* Matches *.center * in element.css */
44 margin: 0 auto;
45 display: table;
46 border-collapse: collapse;
47 clear: none;
48 float: none;
49 }
50
51 /* Hide the caption for frameless and plain floated images */
52 > figcaption {
53 display: none;
54 }
55 }
56
57 figure[ typeof~='mw:File/Thumb' ],
58 figure[ typeof~='mw:File/Frame' ] {
59 display: table;
60 text-align: center;
61 border-collapse: collapse;
62 line-height: 0;
63
64 > a {
65 // The addition of the class is needed for higher specificity
66 // than Vector's print styles
67 .mw-body-content & {
68 border: 0;
69 }
70 }
71
72 // Default where page content language is not set
73 // Allow to flip
74 margin: @margin-tright;
75 clear: right;
76 float: right;
77
78 // Defaults for page content language
79
80 .mw-content-ltr & {
81 /* @noflip */
82 margin: @margin-tright;
83 /* @noflip */
84 clear: right;
85 /* @noflip */
86 float: right;
87 }
88
89 .mw-content-rtl & {
90 /* @noflip */
91 margin: @margin-tleft;
92 /* @noflip */
93 clear: left;
94 /* @noflip */
95 float: left;
96 }
97
98 // Override defaults when explicitly set
99 // Order of application is important, so don't combine with the defaults
100
101 &.mw-halign-right {
102 /* @noflip */
103 margin: @margin-tright;
104 /* @noflip */
105 clear: right;
106 /* @noflip */
107 float: right;
108 }
109
110 &.mw-halign-left {
111 /* @noflip */
112 margin: @margin-tleft;
113 /* @noflip */
114 clear: left;
115 /* @noflip */
116 float: left;
117 }
118
119 &.mw-halign-none {
120 /* Override the default margin from mw-content-xxx above */
121 margin: 0;
122 margin-bottom: @margin-bottom-thumb;
123 clear: none;
124 float: none;
125 }
126
127 &.mw-halign-center {
128 /* Override the default margin from mw-content-xxx above
129 * And, matches *.center * in element.css
130 */
131 margin: 0 auto @margin-bottom-thumb auto;
132 clear: none;
133 float: none;
134 }
135
136 > :not( figcaption ) {
137 .mw-file-element {
138 margin: 0.75em;
139 margin-bottom: 0.5em;
140 }
141
142 /**
143 * Broken media get a span instead.
144 */
145 .mw-broken-media {
146 display: inline-block;
147 line-height: 1.5;
148 word-break: break-word; // Same as in the figcaption
149 /* This is hardcoded in Linker::makeThumbLink2 for broken media */
150 width: 180px;
151 }
152 }
153
154 > figcaption {
155 display: table-caption;
156 caption-side: bottom;
157 line-height: @line-height-thumbcaption;
158 min-height: 1em;
159
160 /**
161 * The "break-word" value is deprecated, however, it's well supported
162 * at 94.73%
163 * https://caniuse.com/mdn-css_properties_word-break_break-word
164 *
165 * The spec suggests it has the same effect as,
166 *
167 * word-break: normal;
168 * overflow-wrap: anywhere;
169 *
170 * https://drafts.csswg.org/css-text-3/#word-break-property
171 *
172 * So, we should use that. However, support for "anywhere" is lagging
173 * at just 72.39%, with Safari being a notable miss.
174 * https://caniuse.com/mdn-css_properties_overflow-wrap_anywhere
175 *
176 * "Soft wrap opportunities introduced by the word break are considered
177 * when calculating min-content intrinsic sizes."
178 * From https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap
179 */
180 word-break: break-word;
181
182 // Default where page content language is not set
183 // Allow to flip
184 text-align: left;
185
186 // Defaults for page content language
187
188 .mw-content-ltr & {
189 /* @noflip */
190 text-align: left;
191 }
192
193 .mw-content-rtl & {
194 /* @noflip */
195 text-align: right;
196 }
197
198 /* taken from .thumbcaption, plus .thumbinner */
199 padding: 0 0.75em 0.75em 0.75em;
200 }
201 }
202
203 // Remove bogus padding from framed images without captions
204 // However, it's still necessary for thumbs because the magnifying icon is present
205 figure[ typeof~='mw:File/Frame' ] > figcaption:empty {
206 padding-bottom: 0.25em; // Accounts for the difference in margin-bottom above
207 min-height: 0;
208 }
209
210 /**
211 * Inline media items
212 */
213 .mw-valign-middle .mw-file-element {
214 vertical-align: middle;
215 }
216
217 .mw-valign-baseline .mw-file-element {
218 vertical-align: baseline;
219 }
220
221 .mw-valign-sub .mw-file-element {
222 vertical-align: sub;
223 }
224
225 .mw-valign-super .mw-file-element {
226 vertical-align: super;
227 }
228
229 .mw-valign-top .mw-file-element {
230 vertical-align: top;
231 }
232
233 .mw-valign-text-top .mw-file-element {
234 vertical-align: text-top;
235 }
236
237 .mw-valign-bottom .mw-file-element {
238 vertical-align: bottom;
239 }
240
241 .mw-valign-text-bottom .mw-file-element {
242 vertical-align: text-bottom;
243 }