Debian Codegraph @

resources/codemirror.mediawiki.less

raw
1 @import 'mediawiki.skin.variables.less';
2
3 @error-color: @color-destructive;
4 @link-color: @color-progressive;
5 @parser-function-color: @color-destructive;
6 @table-color: #d08;
7 @table-color-dark: #ff5edd;
8 @template-color: #80c;
9 @template-color-dark: #af84e6;
10 @template-variable-color: #ac6600;
11 @wikitext-formatting-color: @color-progressive--focus;
12 @wikitext-formatting-color-dark: @color-progressive--hover;
13 @xml-tag-color: @color-content-added;
14 @template-background-color: #a11;
15 @ext-background-color: #eee;
16 @link-background-color: #219;
17 @skip-formatting-color: #adf;
18
19 .ground( @template: 0, @ext: 0, @link: 0 ) {
20 @template-shade: fade( @template-background-color, 4% * @template );
21 @ext-shade: fade( @ext-background-color, 4% * @ext );
22 @link-shade: fade( @link-background-color, 4% * @link );
23 background-color: average( average( @template-shade, @ext-shade ), @link-shade );
24 }
25
26 .darkmode( @prop, @value ) {
27 @media screen {
28 html.skin-theme-clientpref-night & {
29 @{prop}: @value;
30 }
31 }
32
33 @media screen and ( prefers-color-scheme: dark ) {
34 html.skin-theme-clientpref-os & {
35 @{prop}: @value;
36 }
37 }
38 }
39
40 .wikitext-formatting-color {
41 color: @wikitext-formatting-color;
42 .darkmode( color, @wikitext-formatting-color-dark );
43 }
44
45 .cm-mw-pagename {
46 text-decoration: underline;
47 }
48
49 .cm-mw-skipformatting {
50 background-color: @skip-formatting-color;
51 }
52 .cm-mw-list,
53 .cm-mw-indenting {
54 .wikitext-formatting-color();
55 font-weight: bold;
56 }
57 // FIXME: Remove camelCase variant after CM6 upgrade is complete (also check Global Search)
58 .cm-mw-doubleUnderscore,
59 .cm-mw-double-underscore,
60 .cm-mw-signature,
61 .cm-mw-hr {
62 .wikitext-formatting-color();
63 font-weight: bold;
64 background-color: @background-color-disabled-subtle;
65 }
66
67 // TODO: Deprecate .cm-mw-mnemonic in favor of -html-entity
68 .cm-mw-mnemonic,
69 .cm-mw-html-entity {
70 color: @xml-tag-color;
71 }
72 .cm-mw-comment {
73 color: @color-subtle;
74 font-weight: normal;
75 }
76 .cm-mw-apostrophes-bold,
77 .cm-mw-apostrophes-italic {
78 .wikitext-formatting-color();
79 }
80 .cm-mw-strong {
81 font-weight: bold;
82 }
83
84 // FIXME: Remove .CodeMirror-line rules after CM6 upgrade
85 pre.CodeMirror-line.cm-mw-section-1,
86 pre.CodeMirror-line-like.cm-mw-section-1,
87 .cm-mw-section-1,
88 .cm-mw-section-1 ~ * {
89 font-size: 1.8em;
90 line-height: 1.2em;
91 }
92 pre.CodeMirror-line.cm-mw-section-2,
93 pre.CodeMirror-line-like.cm-mw-section-2,
94 .cm-mw-section-2,
95 .cm-mw-section-2 ~ * {
96 font-size: 1.5em;
97 line-height: 1.2em;
98 }
99 pre.CodeMirror-line.cm-mw-section-3,
100 pre.CodeMirror-line-like.cm-mw-section-3,
101 pre.CodeMirror-line.cm-mw-section-4,
102 pre.CodeMirror-line-like.cm-mw-section-4,
103 pre.CodeMirror-line.cm-mw-section-5,
104 pre.CodeMirror-line-like.cm-mw-section-5,
105 pre.CodeMirror-line.cm-mw-section-6,
106 pre.CodeMirror-line-like.cm-mw-section-6,
107 /* TODO: remove overqualified `span` after CM6 upgrade */
108 span.cm-mw-section-3 ~ *,
109 span.cm-mw-section-4 ~ *,
110 span.cm-mw-section-5 ~ *,
111 span.cm-mw-section-6 ~ * {
112 font-weight: bold;
113 }
114
115 .cm-mw-template {
116 color: @template-color;
117 font-weight: normal;
118
119 html.skin-theme-clientpref-night & {
120 color: @template-color-dark;
121 }
122
123 @media ( prefers-color-scheme: dark ) {
124 html.skin-theme-clientpref-os & {
125 color: @template-color-dark;
126 }
127 }
128 }
129
130 // TODO: deprecate/remove after CM6 upgrade
131 .cm-mw-template-name-mnemonic {
132 font-weight: normal;
133 }
134
135 .cm-mw-template-name,
136 .cm-mw-template-argument-name,
137 .cm-mw-template-delimiter,
138 .cm-mw-template-bracket {
139 color: @template-color;
140 font-weight: bold;
141 .darkmode( color, @template-color-dark );
142 }
143
144 .cm-mw-templatevariable,
145 .cm-mw-templatevariable-bracket {
146 color: @template-variable-color;
147 font-weight: normal;
148 }
149 .cm-mw-templatevariable-name,
150 .cm-mw-templatevariable-delimiter {
151 color: @template-variable-color;
152 font-weight: bold;
153 }
154
155 .cm-mw-parserfunction {
156 font-weight: normal;
157 }
158 .cm-mw-parserfunction-name,
159 .cm-mw-parserfunction-bracket,
160 .cm-mw-parserfunction-delimiter {
161 color: @parser-function-color;
162 font-weight: bold;
163 }
164
165 pre.CodeMirror-line.cm-mw-exttag,
166 pre.CodeMirror-line-like.cm-mw-exttag {
167 .ground( @ext: 0.5 );
168 }
169 .cm-mw-exttag {
170 .ground( @ext: 1 );
171 }
172 .cm-mw-exttag-name,
173 .cm-mw-htmltag-name {
174 color: @xml-tag-color;
175 font-weight: bold;
176 }
177 .cm-mw-exttag-bracket,
178 .cm-mw-exttag-attribute,
179 .cm-mw-htmltag-bracket,
180 .cm-mw-htmltag-attribute {
181 color: @xml-tag-color;
182 font-weight: normal;
183 }
184
185 .cm-mw-tag-pre,
186 .cm-mw-tag-nowiki,
187 pre.CodeMirror-line.cm-mw-tag-pre,
188 pre.CodeMirror-line-like.cm-mw-tag-pre,
189 pre.CodeMirror-line.cm-mw-tag-nowiki,
190 pre.CodeMirror-line-like.cm-mw-tag-nowiki {
191 background-color: rgba( 0, 0, 0, 0.04 );
192 .darkmode( background-color, rgba( 255, 255, 255, 0.06 ) );
193 }
194
195 .cm-mw-link,
196 .cm-mw-link-tosection,
197 .cm-mw-section-header {
198 .wikitext-formatting-color();
199 font-weight: normal;
200 }
201 .cm-mw-link-pagename,
202 .cm-mw-link-bracket,
203 .cm-mw-link-delimiter,
204 .cm-mw-extlink,
205 .cm-mw-free-extlink {
206 color: @link-color;
207 &:not( .cm-mw-strong ) {
208 font-weight: normal;
209 }
210 }
211 .cm-mw-extlink-protocol,
212 .cm-mw-free-extlink-protocol,
213 .cm-mw-extlink-bracket {
214 color: @link-color;
215 font-weight: bold;
216 }
217
218 .cm-mw-table-bracket,
219 .cm-mw-table-delimiter {
220 color: @table-color;
221 font-weight: bold;
222 .darkmode( color, @table-color-dark );
223 }
224 .cm-mw-table-definition {
225 color: @table-color;
226 font-weight: normal;
227 .darkmode( color, @table-color-dark );
228 }
229 .cm-mw-table-caption {
230 font-weight: bold;
231 }
232
233 .cm-mw-template2-ground {
234 .ground( @template: 1 );
235 }
236 .cm-mw-template3-ground {
237 .ground( @template: 2 );
238 }
239 .cm-mw-ext-ground,
240 .cm-mw-template-ext-ground {
241 .ground( @ext: 1 );
242 }
243 .cm-mw-ext2-ground,
244 .cm-mw-template-ext2-ground {
245 .ground( @ext: 2 );
246 }
247 .cm-mw-ext3-ground,
248 .cm-mw-template-ext3-ground {
249 .ground( @ext: 3 );
250 }
251 .cm-mw-link-ground,
252 .cm-mw-ext-link-ground,
253 .cm-mw-template-link-ground {
254 .ground( @link: 1 );
255 }
256 .cm-mw-ext2-link-ground,
257 .cm-mw-template-ext-link-ground {
258 .ground( @ext: 1, @link: 1 );
259 }
260 .cm-mw-ext3-link-ground,
261 .cm-mw-template-ext2-link-ground {
262 .ground( @ext: 2, @link: 1 );
263 }
264 .cm-mw-template-ext3-link-ground {
265 .ground( @ext: 3, @link: 1 );
266 }
267
268 .cm-mw-template2-ext-ground {
269 .ground( @template: 1, @ext: 1 );
270 }
271 .cm-mw-template2-ext2-ground {
272 .ground( @template: 1, @ext: 2 );
273 }
274 .cm-mw-template2-ext3-ground {
275 .ground( @template: 1, @ext: 3 );
276 }
277 .cm-mw-template2-link-ground {
278 .ground( @template: 1, @link: 1 );
279 }
280 .cm-mw-template2-ext-link-ground {
281 .ground( @template: 1, @ext: 1, @link: 1 );
282 }
283 .cm-mw-template2-ext2-link-ground {
284 .ground( @template: 1, @ext: 2, @link: 1 );
285 }
286 .cm-mw-template2-ext3-link-ground {
287 .ground( @template: 1, @ext: 3, @link: 1 );
288 }
289
290 .cm-mw-template3-ext-ground {
291 .ground( @template: 2, @ext: 1 );
292 }
293 .cm-mw-template3-ext2-ground {
294 .ground( @template: 2, @ext: 2 );
295 }
296 .cm-mw-template3-ext3-ground {
297 .ground( @template: 2, @ext: 3 );
298 }
299 .cm-mw-template3-link-ground {
300 .ground( @template: 2, @link: 1 );
301 }
302 .cm-mw-template3-ext-link-ground {
303 .ground( @template: 2, @ext: 1, @link: 1 );
304 }
305 .cm-mw-template3-ext2-link-ground {
306 .ground( @template: 2, @ext: 2, @link: 1 );
307 }
308 .cm-mw-template3-ext3-link-ground {
309 .ground( @template: 2, @ext: 3, @link: 1 );
310 }
311
312 .cm-mw-error {
313 color: @error-color;
314 }
315
316 .cm-mw-em {
317 font-style: italic;
318 }