cssstyle 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CSSStyleDeclaration.js +6 -1
- package/lib/allProperties.js +27 -17
- package/lib/implementedProperties.js +84 -88
- package/lib/properties/margin.js +1 -0
- package/lib/properties/padding.js +1 -0
- package/lib/properties.js +4 -171
- package/package.json +15 -15
- package/lib/CSSStyleDeclaration.test.js +0 -737
- package/lib/parsers.test.js +0 -146
package/lib/properties.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// autogenerated -
|
|
3
|
+
// autogenerated - 9/7/2024
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
*
|
|
@@ -8,77 +8,56 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
var external_dependency_parsers_0 = require("./parsers.js");
|
|
11
|
-
|
|
12
11
|
var external_dependency_constants_1 = require("./constants.js");
|
|
13
|
-
|
|
14
12
|
var azimuth_export_definition;
|
|
15
13
|
azimuth_export_definition = {
|
|
16
14
|
set: function (v) {
|
|
17
15
|
var valueType = external_dependency_parsers_0.valueType(v);
|
|
18
|
-
|
|
19
16
|
if (valueType === external_dependency_parsers_0.TYPES.ANGLE) {
|
|
20
17
|
return this._setProperty('azimuth', external_dependency_parsers_0.parseAngle(v));
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
if (valueType === external_dependency_parsers_0.TYPES.KEYWORD) {
|
|
24
20
|
var keywords = v.toLowerCase().trim().split(/\s+/);
|
|
25
21
|
var hasBehind = false;
|
|
26
|
-
|
|
27
22
|
if (keywords.length > 2) {
|
|
28
23
|
return;
|
|
29
24
|
}
|
|
30
|
-
|
|
31
25
|
var behindIndex = keywords.indexOf('behind');
|
|
32
26
|
hasBehind = behindIndex !== -1;
|
|
33
|
-
|
|
34
27
|
if (keywords.length === 2) {
|
|
35
28
|
if (!hasBehind) {
|
|
36
29
|
return;
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
keywords.splice(behindIndex, 1);
|
|
40
32
|
}
|
|
41
|
-
|
|
42
33
|
if (keywords[0] === 'leftwards' || keywords[0] === 'rightwards') {
|
|
43
34
|
if (hasBehind) {
|
|
44
35
|
return;
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
return this._setProperty('azimuth', keywords[0]);
|
|
48
38
|
}
|
|
49
|
-
|
|
50
39
|
if (keywords[0] === 'behind') {
|
|
51
40
|
return this._setProperty('azimuth', '180deg');
|
|
52
41
|
}
|
|
53
|
-
|
|
54
42
|
switch (keywords[0]) {
|
|
55
43
|
case 'left-side':
|
|
56
44
|
return this._setProperty('azimuth', '270deg');
|
|
57
|
-
|
|
58
45
|
case 'far-left':
|
|
59
46
|
return this._setProperty('azimuth', (hasBehind ? 240 : 300) + 'deg');
|
|
60
|
-
|
|
61
47
|
case 'left':
|
|
62
48
|
return this._setProperty('azimuth', (hasBehind ? 220 : 320) + 'deg');
|
|
63
|
-
|
|
64
49
|
case 'center-left':
|
|
65
50
|
return this._setProperty('azimuth', (hasBehind ? 200 : 340) + 'deg');
|
|
66
|
-
|
|
67
51
|
case 'center':
|
|
68
52
|
return this._setProperty('azimuth', (hasBehind ? 180 : 0) + 'deg');
|
|
69
|
-
|
|
70
53
|
case 'center-right':
|
|
71
54
|
return this._setProperty('azimuth', (hasBehind ? 160 : 20) + 'deg');
|
|
72
|
-
|
|
73
55
|
case 'right':
|
|
74
56
|
return this._setProperty('azimuth', (hasBehind ? 140 : 40) + 'deg');
|
|
75
|
-
|
|
76
57
|
case 'far-right':
|
|
77
58
|
return this._setProperty('azimuth', (hasBehind ? 120 : 60) + 'deg');
|
|
78
|
-
|
|
79
59
|
case 'right-side':
|
|
80
60
|
return this._setProperty('azimuth', '90deg');
|
|
81
|
-
|
|
82
61
|
default:
|
|
83
62
|
return;
|
|
84
63
|
}
|
|
@@ -91,33 +70,25 @@ azimuth_export_definition = {
|
|
|
91
70
|
configurable: true
|
|
92
71
|
};
|
|
93
72
|
var backgroundColor_export_isValid, backgroundColor_export_definition;
|
|
94
|
-
|
|
95
73
|
var backgroundColor_local_var_parse = function parse(v) {
|
|
96
74
|
var parsed = external_dependency_parsers_0.parseColor(v);
|
|
97
|
-
|
|
98
75
|
if (parsed !== undefined) {
|
|
99
76
|
return parsed;
|
|
100
77
|
}
|
|
101
|
-
|
|
102
78
|
if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'transparent' || v.toLowerCase() === 'inherit')) {
|
|
103
79
|
return v;
|
|
104
80
|
}
|
|
105
|
-
|
|
106
81
|
return undefined;
|
|
107
82
|
};
|
|
108
|
-
|
|
109
83
|
backgroundColor_export_isValid = function isValid(v) {
|
|
110
84
|
return backgroundColor_local_var_parse(v) !== undefined;
|
|
111
85
|
};
|
|
112
|
-
|
|
113
86
|
backgroundColor_export_definition = {
|
|
114
87
|
set: function (v) {
|
|
115
88
|
var parsed = backgroundColor_local_var_parse(v);
|
|
116
|
-
|
|
117
89
|
if (parsed === undefined) {
|
|
118
90
|
return;
|
|
119
91
|
}
|
|
120
|
-
|
|
121
92
|
this._setProperty('background-color', parsed);
|
|
122
93
|
},
|
|
123
94
|
get: function () {
|
|
@@ -127,25 +98,19 @@ backgroundColor_export_definition = {
|
|
|
127
98
|
configurable: true
|
|
128
99
|
};
|
|
129
100
|
var backgroundImage_export_isValid, backgroundImage_export_definition;
|
|
130
|
-
|
|
131
101
|
var backgroundImage_local_var_parse = function parse(v) {
|
|
132
102
|
var parsed = external_dependency_parsers_0.parseUrl(v);
|
|
133
|
-
|
|
134
103
|
if (parsed !== undefined) {
|
|
135
104
|
return parsed;
|
|
136
105
|
}
|
|
137
|
-
|
|
138
106
|
if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'none' || v.toLowerCase() === 'inherit')) {
|
|
139
107
|
return v;
|
|
140
108
|
}
|
|
141
|
-
|
|
142
109
|
return undefined;
|
|
143
110
|
};
|
|
144
|
-
|
|
145
111
|
backgroundImage_export_isValid = function isValid(v) {
|
|
146
112
|
return backgroundImage_local_var_parse(v) !== undefined;
|
|
147
113
|
};
|
|
148
|
-
|
|
149
114
|
backgroundImage_export_definition = {
|
|
150
115
|
set: function (v) {
|
|
151
116
|
this._setProperty('background-image', backgroundImage_local_var_parse(v));
|
|
@@ -157,19 +122,15 @@ backgroundImage_export_definition = {
|
|
|
157
122
|
configurable: true
|
|
158
123
|
};
|
|
159
124
|
var backgroundRepeat_export_isValid, backgroundRepeat_export_definition;
|
|
160
|
-
|
|
161
125
|
var backgroundRepeat_local_var_parse = function parse(v) {
|
|
162
126
|
if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'repeat' || v.toLowerCase() === 'repeat-x' || v.toLowerCase() === 'repeat-y' || v.toLowerCase() === 'no-repeat' || v.toLowerCase() === 'inherit')) {
|
|
163
127
|
return v;
|
|
164
128
|
}
|
|
165
|
-
|
|
166
129
|
return undefined;
|
|
167
130
|
};
|
|
168
|
-
|
|
169
131
|
backgroundRepeat_export_isValid = function isValid(v) {
|
|
170
132
|
return backgroundRepeat_local_var_parse(v) !== undefined;
|
|
171
133
|
};
|
|
172
|
-
|
|
173
134
|
backgroundRepeat_export_definition = {
|
|
174
135
|
set: function (v) {
|
|
175
136
|
this._setProperty('background-repeat', backgroundRepeat_local_var_parse(v));
|
|
@@ -181,17 +142,14 @@ backgroundRepeat_export_definition = {
|
|
|
181
142
|
configurable: true
|
|
182
143
|
};
|
|
183
144
|
var backgroundAttachment_export_isValid, backgroundAttachment_export_definition;
|
|
184
|
-
|
|
185
145
|
var backgroundAttachment_local_var_isValid = backgroundAttachment_export_isValid = function isValid(v) {
|
|
186
146
|
return external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'scroll' || v.toLowerCase() === 'fixed' || v.toLowerCase() === 'inherit');
|
|
187
147
|
};
|
|
188
|
-
|
|
189
148
|
backgroundAttachment_export_definition = {
|
|
190
149
|
set: function (v) {
|
|
191
150
|
if (!backgroundAttachment_local_var_isValid(v)) {
|
|
192
151
|
return;
|
|
193
152
|
}
|
|
194
|
-
|
|
195
153
|
this._setProperty('background-attachment', v);
|
|
196
154
|
},
|
|
197
155
|
get: function () {
|
|
@@ -202,56 +160,43 @@ backgroundAttachment_export_definition = {
|
|
|
202
160
|
};
|
|
203
161
|
var backgroundPosition_export_isValid, backgroundPosition_export_definition;
|
|
204
162
|
var backgroundPosition_local_var_valid_keywords = ['top', 'center', 'bottom', 'left', 'right'];
|
|
205
|
-
|
|
206
163
|
var backgroundPosition_local_var_parse = function parse(v) {
|
|
207
164
|
if (v === '' || v === null) {
|
|
208
165
|
return undefined;
|
|
209
166
|
}
|
|
210
|
-
|
|
211
167
|
var parts = v.split(/\s+/);
|
|
212
|
-
|
|
213
168
|
if (parts.length > 2 || parts.length < 1) {
|
|
214
169
|
return undefined;
|
|
215
170
|
}
|
|
216
|
-
|
|
217
171
|
var types = [];
|
|
218
172
|
parts.forEach(function (part, index) {
|
|
219
173
|
types[index] = external_dependency_parsers_0.valueType(part);
|
|
220
174
|
});
|
|
221
|
-
|
|
222
175
|
if (parts.length === 1) {
|
|
223
176
|
if (types[0] === external_dependency_parsers_0.TYPES.LENGTH || types[0] === external_dependency_parsers_0.TYPES.PERCENT) {
|
|
224
177
|
return v;
|
|
225
178
|
}
|
|
226
|
-
|
|
227
179
|
if (types[0] === external_dependency_parsers_0.TYPES.KEYWORD) {
|
|
228
180
|
if (backgroundPosition_local_var_valid_keywords.indexOf(v.toLowerCase()) !== -1 || v.toLowerCase() === 'inherit') {
|
|
229
181
|
return v;
|
|
230
182
|
}
|
|
231
183
|
}
|
|
232
|
-
|
|
233
184
|
return undefined;
|
|
234
185
|
}
|
|
235
|
-
|
|
236
186
|
if ((types[0] === external_dependency_parsers_0.TYPES.LENGTH || types[0] === external_dependency_parsers_0.TYPES.PERCENT) && (types[1] === external_dependency_parsers_0.TYPES.LENGTH || types[1] === external_dependency_parsers_0.TYPES.PERCENT)) {
|
|
237
187
|
return v;
|
|
238
188
|
}
|
|
239
|
-
|
|
240
189
|
if (types[0] !== external_dependency_parsers_0.TYPES.KEYWORD || types[1] !== external_dependency_parsers_0.TYPES.KEYWORD) {
|
|
241
190
|
return undefined;
|
|
242
191
|
}
|
|
243
|
-
|
|
244
192
|
if (backgroundPosition_local_var_valid_keywords.indexOf(parts[0]) !== -1 && backgroundPosition_local_var_valid_keywords.indexOf(parts[1]) !== -1) {
|
|
245
193
|
return v;
|
|
246
194
|
}
|
|
247
|
-
|
|
248
195
|
return undefined;
|
|
249
196
|
};
|
|
250
|
-
|
|
251
197
|
backgroundPosition_export_isValid = function isValid(v) {
|
|
252
198
|
return backgroundPosition_local_var_parse(v) !== undefined;
|
|
253
199
|
};
|
|
254
|
-
|
|
255
200
|
backgroundPosition_export_definition = {
|
|
256
201
|
set: function (v) {
|
|
257
202
|
this._setProperty('background-position', backgroundPosition_local_var_parse(v));
|
|
@@ -294,47 +239,34 @@ background_export_definition = {
|
|
|
294
239
|
var borderWidth_export_isValid, borderWidth_export_definition;
|
|
295
240
|
// the valid border-widths:
|
|
296
241
|
var borderWidth_local_var_widths = ['thin', 'medium', 'thick'];
|
|
297
|
-
|
|
298
242
|
borderWidth_export_isValid = function parse(v) {
|
|
299
243
|
var length = external_dependency_parsers_0.parseLength(v);
|
|
300
|
-
|
|
301
244
|
if (length !== undefined) {
|
|
302
245
|
return true;
|
|
303
246
|
}
|
|
304
|
-
|
|
305
247
|
if (typeof v !== 'string') {
|
|
306
248
|
return false;
|
|
307
249
|
}
|
|
308
|
-
|
|
309
250
|
if (v === '') {
|
|
310
251
|
return true;
|
|
311
252
|
}
|
|
312
|
-
|
|
313
253
|
v = v.toLowerCase();
|
|
314
|
-
|
|
315
254
|
if (borderWidth_local_var_widths.indexOf(v) === -1) {
|
|
316
255
|
return false;
|
|
317
256
|
}
|
|
318
|
-
|
|
319
257
|
return true;
|
|
320
258
|
};
|
|
321
|
-
|
|
322
259
|
var borderWidth_local_var_isValid = borderWidth_export_isValid;
|
|
323
|
-
|
|
324
260
|
var borderWidth_local_var_parser = function (v) {
|
|
325
261
|
var length = external_dependency_parsers_0.parseLength(v);
|
|
326
|
-
|
|
327
262
|
if (length !== undefined) {
|
|
328
263
|
return length;
|
|
329
264
|
}
|
|
330
|
-
|
|
331
265
|
if (borderWidth_local_var_isValid(v)) {
|
|
332
266
|
return v.toLowerCase();
|
|
333
267
|
}
|
|
334
|
-
|
|
335
268
|
return undefined;
|
|
336
269
|
};
|
|
337
|
-
|
|
338
270
|
borderWidth_export_definition = {
|
|
339
271
|
set: external_dependency_parsers_0.implicitSetter('border', 'width', borderWidth_local_var_isValid, borderWidth_local_var_parser),
|
|
340
272
|
get: function () {
|
|
@@ -346,21 +278,16 @@ borderWidth_export_definition = {
|
|
|
346
278
|
var borderStyle_export_isValid, borderStyle_export_definition;
|
|
347
279
|
// the valid border-styles:
|
|
348
280
|
var borderStyle_local_var_styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'];
|
|
349
|
-
|
|
350
281
|
borderStyle_export_isValid = function parse(v) {
|
|
351
282
|
return typeof v === 'string' && (v === '' || borderStyle_local_var_styles.indexOf(v) !== -1);
|
|
352
283
|
};
|
|
353
|
-
|
|
354
284
|
var borderStyle_local_var_isValid = borderStyle_export_isValid;
|
|
355
|
-
|
|
356
285
|
var borderStyle_local_var_parser = function (v) {
|
|
357
286
|
if (borderStyle_local_var_isValid(v)) {
|
|
358
287
|
return v.toLowerCase();
|
|
359
288
|
}
|
|
360
|
-
|
|
361
289
|
return undefined;
|
|
362
290
|
};
|
|
363
|
-
|
|
364
291
|
borderStyle_export_definition = {
|
|
365
292
|
set: external_dependency_parsers_0.implicitSetter('border', 'style', borderStyle_local_var_isValid, borderStyle_local_var_parser),
|
|
366
293
|
get: function () {
|
|
@@ -370,25 +297,19 @@ borderStyle_export_definition = {
|
|
|
370
297
|
configurable: true
|
|
371
298
|
};
|
|
372
299
|
var borderColor_export_isValid, borderColor_export_definition;
|
|
373
|
-
|
|
374
300
|
borderColor_export_isValid = function parse(v) {
|
|
375
301
|
if (typeof v !== 'string') {
|
|
376
302
|
return false;
|
|
377
303
|
}
|
|
378
|
-
|
|
379
304
|
return v === '' || v.toLowerCase() === 'transparent' || external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.COLOR;
|
|
380
305
|
};
|
|
381
|
-
|
|
382
306
|
var borderColor_local_var_isValid = borderColor_export_isValid;
|
|
383
|
-
|
|
384
307
|
var borderColor_local_var_parser = function (v) {
|
|
385
308
|
if (borderColor_local_var_isValid(v)) {
|
|
386
309
|
return v.toLowerCase();
|
|
387
310
|
}
|
|
388
|
-
|
|
389
311
|
return undefined;
|
|
390
312
|
};
|
|
391
|
-
|
|
392
313
|
borderColor_export_definition = {
|
|
393
314
|
set: external_dependency_parsers_0.implicitSetter('border', 'color', borderColor_local_var_isValid, borderColor_local_var_parser),
|
|
394
315
|
get: function () {
|
|
@@ -419,7 +340,6 @@ border_export_definition = {
|
|
|
419
340
|
if (v.toString().toLowerCase() === 'none') {
|
|
420
341
|
v = '';
|
|
421
342
|
}
|
|
422
|
-
|
|
423
343
|
border_local_var_myShorthandSetter.call(this, v);
|
|
424
344
|
this.removeProperty('border-top');
|
|
425
345
|
this.removeProperty('border-left');
|
|
@@ -457,7 +377,6 @@ borderBottomStyle_export_definition = {
|
|
|
457
377
|
v = '';
|
|
458
378
|
this.removeProperty('border-bottom-width');
|
|
459
379
|
}
|
|
460
|
-
|
|
461
380
|
this._setProperty('border-bottom-style', v);
|
|
462
381
|
}
|
|
463
382
|
},
|
|
@@ -503,15 +422,12 @@ borderBottom_export_definition = {
|
|
|
503
422
|
configurable: true
|
|
504
423
|
};
|
|
505
424
|
var borderCollapse_export_definition;
|
|
506
|
-
|
|
507
425
|
var borderCollapse_local_var_parse = function parse(v) {
|
|
508
426
|
if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'collapse' || v.toLowerCase() === 'separate' || v.toLowerCase() === 'inherit')) {
|
|
509
427
|
return v;
|
|
510
428
|
}
|
|
511
|
-
|
|
512
429
|
return undefined;
|
|
513
430
|
};
|
|
514
|
-
|
|
515
431
|
borderCollapse_export_definition = {
|
|
516
432
|
set: function (v) {
|
|
517
433
|
this._setProperty('border-collapse', borderCollapse_local_var_parse(v));
|
|
@@ -545,7 +461,6 @@ borderLeftStyle_export_definition = {
|
|
|
545
461
|
v = '';
|
|
546
462
|
this.removeProperty('border-left-width');
|
|
547
463
|
}
|
|
548
|
-
|
|
549
464
|
this._setProperty('border-left-style', v);
|
|
550
465
|
}
|
|
551
466
|
},
|
|
@@ -613,7 +528,6 @@ borderRightStyle_export_definition = {
|
|
|
613
528
|
v = '';
|
|
614
529
|
this.removeProperty('border-right-width');
|
|
615
530
|
}
|
|
616
|
-
|
|
617
531
|
this._setProperty('border-right-style', v);
|
|
618
532
|
}
|
|
619
533
|
},
|
|
@@ -659,29 +573,24 @@ borderRight_export_definition = {
|
|
|
659
573
|
configurable: true
|
|
660
574
|
};
|
|
661
575
|
var borderSpacing_export_definition;
|
|
662
|
-
|
|
663
576
|
// <length> <length>? | inherit
|
|
664
577
|
// if one, it applies to both horizontal and verical spacing
|
|
665
578
|
// if two, the first applies to the horizontal and the second applies to vertical spacing
|
|
579
|
+
|
|
666
580
|
var borderSpacing_local_var_parse = function parse(v) {
|
|
667
581
|
if (v === '' || v === null) {
|
|
668
582
|
return undefined;
|
|
669
583
|
}
|
|
670
|
-
|
|
671
584
|
if (v === 0) {
|
|
672
585
|
return '0px';
|
|
673
586
|
}
|
|
674
|
-
|
|
675
587
|
if (v.toLowerCase() === 'inherit') {
|
|
676
588
|
return v;
|
|
677
589
|
}
|
|
678
|
-
|
|
679
590
|
var parts = v.split(/\s+/);
|
|
680
|
-
|
|
681
591
|
if (parts.length !== 1 && parts.length !== 2) {
|
|
682
592
|
return undefined;
|
|
683
593
|
}
|
|
684
|
-
|
|
685
594
|
parts.forEach(function (part) {
|
|
686
595
|
if (external_dependency_parsers_0.valueType(part) !== external_dependency_parsers_0.TYPES.LENGTH) {
|
|
687
596
|
return undefined;
|
|
@@ -689,7 +598,6 @@ var borderSpacing_local_var_parse = function parse(v) {
|
|
|
689
598
|
});
|
|
690
599
|
return v;
|
|
691
600
|
};
|
|
692
|
-
|
|
693
601
|
borderSpacing_export_definition = {
|
|
694
602
|
set: function (v) {
|
|
695
603
|
this._setProperty('border-spacing', borderSpacing_local_var_parse(v));
|
|
@@ -723,7 +631,6 @@ borderTopStyle_export_definition = {
|
|
|
723
631
|
v = '';
|
|
724
632
|
this.removeProperty('border-top-width');
|
|
725
633
|
}
|
|
726
|
-
|
|
727
634
|
this._setProperty('border-top-style', v);
|
|
728
635
|
}
|
|
729
636
|
},
|
|
@@ -793,48 +700,36 @@ clear_export_definition = {
|
|
|
793
700
|
};
|
|
794
701
|
var clip_export_definition;
|
|
795
702
|
var clip_local_var_shape_regex = /^rect\((.*)\)$/i;
|
|
796
|
-
|
|
797
703
|
var clip_local_var_parse = function (val) {
|
|
798
704
|
if (val === '' || val === null) {
|
|
799
705
|
return val;
|
|
800
706
|
}
|
|
801
|
-
|
|
802
707
|
if (typeof val !== 'string') {
|
|
803
708
|
return undefined;
|
|
804
709
|
}
|
|
805
|
-
|
|
806
710
|
val = val.toLowerCase();
|
|
807
|
-
|
|
808
711
|
if (val === 'auto' || val === 'inherit') {
|
|
809
712
|
return val;
|
|
810
713
|
}
|
|
811
|
-
|
|
812
714
|
var matches = val.match(clip_local_var_shape_regex);
|
|
813
|
-
|
|
814
715
|
if (!matches) {
|
|
815
716
|
return undefined;
|
|
816
717
|
}
|
|
817
|
-
|
|
818
718
|
var parts = matches[1].split(/\s*,\s*/);
|
|
819
|
-
|
|
820
719
|
if (parts.length !== 4) {
|
|
821
720
|
return undefined;
|
|
822
721
|
}
|
|
823
|
-
|
|
824
722
|
var valid = parts.every(function (part, index) {
|
|
825
723
|
var measurement = external_dependency_parsers_0.parseMeasurement(part);
|
|
826
724
|
parts[index] = measurement;
|
|
827
725
|
return measurement !== undefined;
|
|
828
726
|
});
|
|
829
|
-
|
|
830
727
|
if (!valid) {
|
|
831
728
|
return undefined;
|
|
832
729
|
}
|
|
833
|
-
|
|
834
730
|
parts = parts.join(', ');
|
|
835
731
|
return val.replace(matches[1], parts);
|
|
836
732
|
};
|
|
837
|
-
|
|
838
733
|
clip_export_definition = {
|
|
839
734
|
set: function (v) {
|
|
840
735
|
this._setProperty('clip', clip_local_var_parse(v));
|
|
@@ -868,11 +763,9 @@ cssFloat_export_definition = {
|
|
|
868
763
|
configurable: true
|
|
869
764
|
};
|
|
870
765
|
var flexGrow_export_isValid, flexGrow_export_definition;
|
|
871
|
-
|
|
872
766
|
flexGrow_export_isValid = function isValid(v, positionAtFlexShorthand) {
|
|
873
767
|
return external_dependency_parsers_0.parseNumber(v) !== undefined && positionAtFlexShorthand === external_dependency_constants_1.POSITION_AT_SHORTHAND.first;
|
|
874
768
|
};
|
|
875
|
-
|
|
876
769
|
flexGrow_export_definition = {
|
|
877
770
|
set: function (v) {
|
|
878
771
|
this._setProperty('flex-grow', external_dependency_parsers_0.parseNumber(v));
|
|
@@ -884,11 +777,9 @@ flexGrow_export_definition = {
|
|
|
884
777
|
configurable: true
|
|
885
778
|
};
|
|
886
779
|
var flexShrink_export_isValid, flexShrink_export_definition;
|
|
887
|
-
|
|
888
780
|
flexShrink_export_isValid = function isValid(v, positionAtFlexShorthand) {
|
|
889
781
|
return external_dependency_parsers_0.parseNumber(v) !== undefined && positionAtFlexShorthand === external_dependency_constants_1.POSITION_AT_SHORTHAND.second;
|
|
890
782
|
};
|
|
891
|
-
|
|
892
783
|
flexShrink_export_definition = {
|
|
893
784
|
set: function (v) {
|
|
894
785
|
this._setProperty('flex-shrink', external_dependency_parsers_0.parseNumber(v));
|
|
@@ -900,23 +791,18 @@ flexShrink_export_definition = {
|
|
|
900
791
|
configurable: true
|
|
901
792
|
};
|
|
902
793
|
var flexBasis_export_isValid, flexBasis_export_definition;
|
|
903
|
-
|
|
904
794
|
function flexBasis_local_fn_parse(v) {
|
|
905
795
|
if (String(v).toLowerCase() === 'auto') {
|
|
906
796
|
return 'auto';
|
|
907
797
|
}
|
|
908
|
-
|
|
909
798
|
if (String(v).toLowerCase() === 'inherit') {
|
|
910
799
|
return 'inherit';
|
|
911
800
|
}
|
|
912
|
-
|
|
913
801
|
return external_dependency_parsers_0.parseMeasurement(v);
|
|
914
802
|
}
|
|
915
|
-
|
|
916
803
|
flexBasis_export_isValid = function isValid(v) {
|
|
917
804
|
return flexBasis_local_fn_parse(v) !== undefined;
|
|
918
805
|
};
|
|
919
|
-
|
|
920
806
|
flexBasis_export_definition = {
|
|
921
807
|
set: function (v) {
|
|
922
808
|
this._setProperty('flex-basis', flexBasis_local_fn_parse(v));
|
|
@@ -943,32 +829,26 @@ var flex_local_var_shorthand_for = {
|
|
|
943
829
|
}
|
|
944
830
|
};
|
|
945
831
|
var flex_local_var_myShorthandSetter = external_dependency_parsers_0.shorthandSetter('flex', flex_local_var_shorthand_for);
|
|
946
|
-
|
|
947
832
|
flex_export_isValid = function isValid(v) {
|
|
948
833
|
return external_dependency_parsers_0.shorthandParser(v, flex_local_var_shorthand_for) !== undefined;
|
|
949
834
|
};
|
|
950
|
-
|
|
951
835
|
flex_export_definition = {
|
|
952
836
|
set: function (v) {
|
|
953
837
|
var normalizedValue = String(v).trim().toLowerCase();
|
|
954
|
-
|
|
955
838
|
if (normalizedValue === 'none') {
|
|
956
839
|
flex_local_var_myShorthandSetter.call(this, '0 0 auto');
|
|
957
840
|
return;
|
|
958
841
|
}
|
|
959
|
-
|
|
960
842
|
if (normalizedValue === 'initial') {
|
|
961
843
|
flex_local_var_myShorthandSetter.call(this, '0 1 auto');
|
|
962
844
|
return;
|
|
963
845
|
}
|
|
964
|
-
|
|
965
846
|
if (normalizedValue === 'auto') {
|
|
966
847
|
this.removeProperty('flex-grow');
|
|
967
848
|
this.removeProperty('flex-shrink');
|
|
968
849
|
this.setProperty('flex-basis', normalizedValue);
|
|
969
850
|
return;
|
|
970
851
|
}
|
|
971
|
-
|
|
972
852
|
flex_local_var_myShorthandSetter.call(this, v);
|
|
973
853
|
},
|
|
974
854
|
get: external_dependency_parsers_0.shorthandGetter('flex', flex_local_var_shorthand_for),
|
|
@@ -999,28 +879,22 @@ floodColor_export_definition = {
|
|
|
999
879
|
};
|
|
1000
880
|
var fontFamily_export_isValid, fontFamily_export_definition;
|
|
1001
881
|
var fontFamily_local_var_partsRegEx = /\s*,\s*/;
|
|
1002
|
-
|
|
1003
882
|
fontFamily_export_isValid = function isValid(v) {
|
|
1004
883
|
if (v === '' || v === null) {
|
|
1005
884
|
return true;
|
|
1006
885
|
}
|
|
1007
|
-
|
|
1008
886
|
var parts = v.split(fontFamily_local_var_partsRegEx);
|
|
1009
887
|
var len = parts.length;
|
|
1010
888
|
var i;
|
|
1011
889
|
var type;
|
|
1012
|
-
|
|
1013
890
|
for (i = 0; i < len; i++) {
|
|
1014
891
|
type = external_dependency_parsers_0.valueType(parts[i]);
|
|
1015
|
-
|
|
1016
892
|
if (type === external_dependency_parsers_0.TYPES.STRING || type === external_dependency_parsers_0.TYPES.KEYWORD) {
|
|
1017
893
|
return true;
|
|
1018
894
|
}
|
|
1019
895
|
}
|
|
1020
|
-
|
|
1021
896
|
return false;
|
|
1022
897
|
};
|
|
1023
|
-
|
|
1024
898
|
fontFamily_export_definition = {
|
|
1025
899
|
set: function (v) {
|
|
1026
900
|
this._setProperty('font-family', v);
|
|
@@ -1034,19 +908,16 @@ fontFamily_export_definition = {
|
|
|
1034
908
|
var fontSize_export_isValid, fontSize_export_definition;
|
|
1035
909
|
var fontSize_local_var_absoluteSizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
|
|
1036
910
|
var fontSize_local_var_relativeSizes = ['larger', 'smaller'];
|
|
1037
|
-
|
|
1038
911
|
fontSize_export_isValid = function (v) {
|
|
1039
912
|
var type = external_dependency_parsers_0.valueType(v.toLowerCase());
|
|
1040
913
|
return type === external_dependency_parsers_0.TYPES.LENGTH || type === external_dependency_parsers_0.TYPES.PERCENT || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_absoluteSizes.indexOf(v.toLowerCase()) !== -1 || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_relativeSizes.indexOf(v.toLowerCase()) !== -1;
|
|
1041
914
|
};
|
|
1042
|
-
|
|
1043
915
|
function fontSize_local_fn_parse(v) {
|
|
1044
916
|
const valueAsString = String(v).toLowerCase();
|
|
1045
917
|
const optionalArguments = fontSize_local_var_absoluteSizes.concat(fontSize_local_var_relativeSizes);
|
|
1046
918
|
const isOptionalArgument = optionalArguments.some(stringValue => stringValue.toLowerCase() === valueAsString);
|
|
1047
919
|
return isOptionalArgument ? valueAsString : external_dependency_parsers_0.parseMeasurement(v);
|
|
1048
920
|
}
|
|
1049
|
-
|
|
1050
921
|
fontSize_export_definition = {
|
|
1051
922
|
set: function (v) {
|
|
1052
923
|
this._setProperty('font-size', fontSize_local_fn_parse(v));
|
|
@@ -1059,11 +930,9 @@ fontSize_export_definition = {
|
|
|
1059
930
|
};
|
|
1060
931
|
var fontStyle_export_isValid, fontStyle_export_definition;
|
|
1061
932
|
var fontStyle_local_var_valid_styles = ['normal', 'italic', 'oblique', 'inherit'];
|
|
1062
|
-
|
|
1063
933
|
fontStyle_export_isValid = function (v) {
|
|
1064
934
|
return fontStyle_local_var_valid_styles.indexOf(v.toLowerCase()) !== -1;
|
|
1065
935
|
};
|
|
1066
|
-
|
|
1067
936
|
fontStyle_export_definition = {
|
|
1068
937
|
set: function (v) {
|
|
1069
938
|
this._setProperty('font-style', v);
|
|
@@ -1076,11 +945,9 @@ fontStyle_export_definition = {
|
|
|
1076
945
|
};
|
|
1077
946
|
var fontVariant_export_isValid, fontVariant_export_definition;
|
|
1078
947
|
var fontVariant_local_var_valid_variants = ['normal', 'small-caps', 'inherit'];
|
|
1079
|
-
|
|
1080
948
|
fontVariant_export_isValid = function isValid(v) {
|
|
1081
949
|
return fontVariant_local_var_valid_variants.indexOf(v.toLowerCase()) !== -1;
|
|
1082
950
|
};
|
|
1083
|
-
|
|
1084
951
|
fontVariant_export_definition = {
|
|
1085
952
|
set: function (v) {
|
|
1086
953
|
this._setProperty('font-variant', v);
|
|
@@ -1093,11 +960,9 @@ fontVariant_export_definition = {
|
|
|
1093
960
|
};
|
|
1094
961
|
var fontWeight_export_isValid, fontWeight_export_definition;
|
|
1095
962
|
var fontWeight_local_var_valid_weights = ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'inherit'];
|
|
1096
|
-
|
|
1097
963
|
fontWeight_export_isValid = function isValid(v) {
|
|
1098
964
|
return fontWeight_local_var_valid_weights.indexOf(v.toLowerCase()) !== -1;
|
|
1099
965
|
};
|
|
1100
|
-
|
|
1101
966
|
fontWeight_export_definition = {
|
|
1102
967
|
set: function (v) {
|
|
1103
968
|
this._setProperty('font-weight', v);
|
|
@@ -1109,12 +974,10 @@ fontWeight_export_definition = {
|
|
|
1109
974
|
configurable: true
|
|
1110
975
|
};
|
|
1111
976
|
var lineHeight_export_isValid, lineHeight_export_definition;
|
|
1112
|
-
|
|
1113
977
|
lineHeight_export_isValid = function isValid(v) {
|
|
1114
978
|
var type = external_dependency_parsers_0.valueType(v);
|
|
1115
979
|
return type === external_dependency_parsers_0.TYPES.KEYWORD && v.toLowerCase() === 'normal' || v.toLowerCase() === 'inherit' || type === external_dependency_parsers_0.TYPES.NUMBER || type === external_dependency_parsers_0.TYPES.LENGTH || type === external_dependency_parsers_0.TYPES.PERCENT;
|
|
1116
980
|
};
|
|
1117
|
-
|
|
1118
981
|
lineHeight_export_definition = {
|
|
1119
982
|
set: function (v) {
|
|
1120
983
|
this._setProperty('line-height', v);
|
|
@@ -1157,11 +1020,9 @@ var font_local_var_setter = external_dependency_parsers_0.shorthandSetter('font'
|
|
|
1157
1020
|
font_export_definition = {
|
|
1158
1021
|
set: function (v) {
|
|
1159
1022
|
var short = external_dependency_parsers_0.shorthandParser(v, font_local_var_shorthand_for);
|
|
1160
|
-
|
|
1161
1023
|
if (short !== undefined) {
|
|
1162
1024
|
return font_local_var_setter.call(this, v);
|
|
1163
1025
|
}
|
|
1164
|
-
|
|
1165
1026
|
if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && font_local_var_static_fonts.indexOf(v.toLowerCase()) !== -1) {
|
|
1166
1027
|
this._setProperty('font', v);
|
|
1167
1028
|
}
|
|
@@ -1171,19 +1032,15 @@ font_export_definition = {
|
|
|
1171
1032
|
configurable: true
|
|
1172
1033
|
};
|
|
1173
1034
|
var height_export_definition;
|
|
1174
|
-
|
|
1175
1035
|
function height_local_fn_parse(v) {
|
|
1176
1036
|
if (String(v).toLowerCase() === 'auto') {
|
|
1177
1037
|
return 'auto';
|
|
1178
1038
|
}
|
|
1179
|
-
|
|
1180
1039
|
if (String(v).toLowerCase() === 'inherit') {
|
|
1181
1040
|
return 'inherit';
|
|
1182
1041
|
}
|
|
1183
|
-
|
|
1184
1042
|
return external_dependency_parsers_0.parseMeasurement(v);
|
|
1185
1043
|
}
|
|
1186
|
-
|
|
1187
1044
|
height_export_definition = {
|
|
1188
1045
|
set: function (v) {
|
|
1189
1046
|
this._setProperty('height', height_local_fn_parse(v));
|
|
@@ -1218,26 +1075,20 @@ lightingColor_export_definition = {
|
|
|
1218
1075
|
};
|
|
1219
1076
|
var margin_export_definition, margin_export_isValid, margin_export_parser;
|
|
1220
1077
|
var margin_local_var_TYPES = external_dependency_parsers_0.TYPES;
|
|
1221
|
-
|
|
1222
1078
|
var margin_local_var_isValid = function (v) {
|
|
1223
1079
|
if (v.toLowerCase() === 'auto') {
|
|
1224
1080
|
return true;
|
|
1225
1081
|
}
|
|
1226
|
-
|
|
1227
1082
|
var type = external_dependency_parsers_0.valueType(v);
|
|
1228
|
-
return type === margin_local_var_TYPES.NULL_OR_EMPTY_STR || type === margin_local_var_TYPES.LENGTH || type === margin_local_var_TYPES.PERCENT || type === margin_local_var_TYPES.INTEGER && (v === '0' || v === 0);
|
|
1083
|
+
return type === margin_local_var_TYPES.NULL_OR_EMPTY_STR || type === margin_local_var_TYPES.LENGTH || type === margin_local_var_TYPES.PERCENT || type === margin_local_var_TYPES.CALC || type === margin_local_var_TYPES.INTEGER && (v === '0' || v === 0);
|
|
1229
1084
|
};
|
|
1230
|
-
|
|
1231
1085
|
var margin_local_var_parser = function (v) {
|
|
1232
1086
|
var V = v.toLowerCase();
|
|
1233
|
-
|
|
1234
1087
|
if (V === 'auto') {
|
|
1235
1088
|
return V;
|
|
1236
1089
|
}
|
|
1237
|
-
|
|
1238
1090
|
return external_dependency_parsers_0.parseMeasurement(v);
|
|
1239
1091
|
};
|
|
1240
|
-
|
|
1241
1092
|
var margin_local_var_mySetter = external_dependency_parsers_0.implicitSetter('margin', '', margin_local_var_isValid, margin_local_var_parser);
|
|
1242
1093
|
var margin_local_var_myGlobal = external_dependency_parsers_0.implicitSetter('margin', '', function () {
|
|
1243
1094
|
return true;
|
|
@@ -1249,17 +1100,13 @@ margin_export_definition = {
|
|
|
1249
1100
|
if (typeof v === 'number') {
|
|
1250
1101
|
v = String(v);
|
|
1251
1102
|
}
|
|
1252
|
-
|
|
1253
1103
|
if (v === null) {
|
|
1254
1104
|
v = '';
|
|
1255
1105
|
}
|
|
1256
|
-
|
|
1257
1106
|
if (typeof v !== 'string') {
|
|
1258
1107
|
return;
|
|
1259
1108
|
}
|
|
1260
|
-
|
|
1261
1109
|
var V = v.toLowerCase();
|
|
1262
|
-
|
|
1263
1110
|
switch (V) {
|
|
1264
1111
|
case 'inherit':
|
|
1265
1112
|
case 'initial':
|
|
@@ -1267,7 +1114,6 @@ margin_export_definition = {
|
|
|
1267
1114
|
case '':
|
|
1268
1115
|
margin_local_var_myGlobal.call(this, V);
|
|
1269
1116
|
break;
|
|
1270
|
-
|
|
1271
1117
|
default:
|
|
1272
1118
|
margin_local_var_mySetter.call(this, v);
|
|
1273
1119
|
break;
|
|
@@ -1373,16 +1219,13 @@ outlineColor_export_definition = {
|
|
|
1373
1219
|
};
|
|
1374
1220
|
var padding_export_definition, padding_export_isValid, padding_export_parser;
|
|
1375
1221
|
var padding_local_var_TYPES = external_dependency_parsers_0.TYPES;
|
|
1376
|
-
|
|
1377
1222
|
var padding_local_var_isValid = function (v) {
|
|
1378
1223
|
var type = external_dependency_parsers_0.valueType(v);
|
|
1379
|
-
return type === padding_local_var_TYPES.NULL_OR_EMPTY_STR || type === padding_local_var_TYPES.LENGTH || type === padding_local_var_TYPES.PERCENT || type === padding_local_var_TYPES.INTEGER && (v === '0' || v === 0);
|
|
1224
|
+
return type === padding_local_var_TYPES.NULL_OR_EMPTY_STR || type === padding_local_var_TYPES.LENGTH || type === padding_local_var_TYPES.PERCENT || type === padding_local_var_TYPES.CALC || type === padding_local_var_TYPES.INTEGER && (v === '0' || v === 0);
|
|
1380
1225
|
};
|
|
1381
|
-
|
|
1382
1226
|
var padding_local_var_parser = function (v) {
|
|
1383
1227
|
return external_dependency_parsers_0.parseMeasurement(v);
|
|
1384
1228
|
};
|
|
1385
|
-
|
|
1386
1229
|
var padding_local_var_mySetter = external_dependency_parsers_0.implicitSetter('padding', '', padding_local_var_isValid, padding_local_var_parser);
|
|
1387
1230
|
var padding_local_var_myGlobal = external_dependency_parsers_0.implicitSetter('padding', '', function () {
|
|
1388
1231
|
return true;
|
|
@@ -1394,17 +1237,13 @@ padding_export_definition = {
|
|
|
1394
1237
|
if (typeof v === 'number') {
|
|
1395
1238
|
v = String(v);
|
|
1396
1239
|
}
|
|
1397
|
-
|
|
1398
1240
|
if (v === null) {
|
|
1399
1241
|
v = '';
|
|
1400
1242
|
}
|
|
1401
|
-
|
|
1402
1243
|
if (typeof v !== 'string') {
|
|
1403
1244
|
return;
|
|
1404
1245
|
}
|
|
1405
|
-
|
|
1406
1246
|
var V = v.toLowerCase();
|
|
1407
|
-
|
|
1408
1247
|
switch (V) {
|
|
1409
1248
|
case 'inherit':
|
|
1410
1249
|
case 'initial':
|
|
@@ -1412,7 +1251,6 @@ padding_export_definition = {
|
|
|
1412
1251
|
case '':
|
|
1413
1252
|
padding_local_var_myGlobal.call(this, V);
|
|
1414
1253
|
break;
|
|
1415
|
-
|
|
1416
1254
|
default:
|
|
1417
1255
|
padding_local_var_mySetter.call(this, v);
|
|
1418
1256
|
break;
|
|
@@ -1671,19 +1509,15 @@ webkitTextStrokeColor_export_definition = {
|
|
|
1671
1509
|
configurable: true
|
|
1672
1510
|
};
|
|
1673
1511
|
var width_export_definition;
|
|
1674
|
-
|
|
1675
1512
|
function width_local_fn_parse(v) {
|
|
1676
1513
|
if (String(v).toLowerCase() === 'auto') {
|
|
1677
1514
|
return 'auto';
|
|
1678
1515
|
}
|
|
1679
|
-
|
|
1680
1516
|
if (String(v).toLowerCase() === 'inherit') {
|
|
1681
1517
|
return 'inherit';
|
|
1682
1518
|
}
|
|
1683
|
-
|
|
1684
1519
|
return external_dependency_parsers_0.parseMeasurement(v);
|
|
1685
1520
|
}
|
|
1686
|
-
|
|
1687
1521
|
width_export_definition = {
|
|
1688
1522
|
set: function (v) {
|
|
1689
1523
|
this._setProperty('width', width_local_fn_parse(v));
|
|
@@ -1694,7 +1528,6 @@ width_export_definition = {
|
|
|
1694
1528
|
enumerable: true,
|
|
1695
1529
|
configurable: true
|
|
1696
1530
|
};
|
|
1697
|
-
|
|
1698
1531
|
module.exports = function (prototype) {
|
|
1699
1532
|
Object.defineProperties(prototype, {
|
|
1700
1533
|
azimuth: azimuth_export_definition,
|