@tbela99/css-parser 0.0.1 → 0.2.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/README.md +318 -34
- package/dist/config.json.js +386 -4
- package/dist/index-umd-web.js +3260 -1563
- package/dist/index.cjs +3259 -1564
- package/dist/index.d.ts +687 -536
- package/dist/lib/ast/expand.js +14 -14
- package/dist/lib/ast/features/calc.js +225 -0
- package/dist/lib/ast/features/index.js +3 -0
- package/dist/lib/ast/features/inlinecssvariables.js +130 -0
- package/dist/lib/ast/features/shorthand.js +46 -0
- package/dist/lib/ast/features/utils/math.js +95 -0
- package/dist/lib/ast/minify.js +401 -372
- package/dist/lib/ast/types.js +101 -0
- package/dist/lib/ast/utils/minifyfeature.js +8 -0
- package/dist/lib/ast/walk.js +37 -9
- package/dist/lib/iterable/set.js +48 -0
- package/dist/lib/iterable/weakmap.js +53 -0
- package/dist/lib/parser/declaration/list.js +18 -4
- package/dist/lib/parser/declaration/map.js +102 -33
- package/dist/lib/parser/declaration/set.js +18 -12
- package/dist/lib/parser/parse.js +661 -421
- package/dist/lib/parser/tokenize.js +82 -46
- package/dist/lib/parser/utils/syntax.js +13 -10
- package/dist/lib/parser/utils/type.js +23 -6
- package/dist/lib/renderer/render.js +253 -84
- package/dist/lib/renderer/sourcemap/lib/encode.js +37 -0
- package/dist/lib/renderer/sourcemap/sourcemap.js +58 -0
- package/dist/lib/renderer/utils/color.js +25 -20
- package/dist/node/index.js +30 -15
- package/dist/web/index.js +36 -19
- package/package.json +9 -6
- package/dist/lib/transform.js +0 -24
package/dist/config.json.js
CHANGED
|
@@ -232,6 +232,317 @@ var properties = {
|
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
234
|
var map = {
|
|
235
|
+
transition: {
|
|
236
|
+
shorthand: "transition",
|
|
237
|
+
multiple: true,
|
|
238
|
+
separator: ",",
|
|
239
|
+
pattern: "transition-property transition-duration transition-timing-function transition-delay transition-behavior",
|
|
240
|
+
keywords: [
|
|
241
|
+
"none",
|
|
242
|
+
"all"
|
|
243
|
+
],
|
|
244
|
+
"default": [
|
|
245
|
+
"0s",
|
|
246
|
+
"0ms",
|
|
247
|
+
"all",
|
|
248
|
+
"ease",
|
|
249
|
+
"none",
|
|
250
|
+
"normal"
|
|
251
|
+
],
|
|
252
|
+
properties: {
|
|
253
|
+
"transition-property": {
|
|
254
|
+
keywords: [
|
|
255
|
+
"none",
|
|
256
|
+
"all"
|
|
257
|
+
],
|
|
258
|
+
"default": [
|
|
259
|
+
],
|
|
260
|
+
types: [
|
|
261
|
+
"Iden"
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
"transition-duration": {
|
|
265
|
+
keywords: [
|
|
266
|
+
],
|
|
267
|
+
"default": [
|
|
268
|
+
"0s",
|
|
269
|
+
"0ms",
|
|
270
|
+
"normal"
|
|
271
|
+
],
|
|
272
|
+
types: [
|
|
273
|
+
"Time"
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
"transition-timing-function": {
|
|
277
|
+
keywords: [
|
|
278
|
+
"ease",
|
|
279
|
+
"ease-in",
|
|
280
|
+
"ease-out",
|
|
281
|
+
"ease-in-out",
|
|
282
|
+
"linear",
|
|
283
|
+
"step-start",
|
|
284
|
+
"step-end"
|
|
285
|
+
],
|
|
286
|
+
"default": [
|
|
287
|
+
"ease"
|
|
288
|
+
],
|
|
289
|
+
types: [
|
|
290
|
+
"TimingFunction"
|
|
291
|
+
],
|
|
292
|
+
mapping: {
|
|
293
|
+
"cubic-bezier(.25,.1,.25,1)": "ease",
|
|
294
|
+
"cubic-bezier(0,0,1,1)": "linear",
|
|
295
|
+
"cubic-bezier(.42,0,1,1)": "ease-in",
|
|
296
|
+
"cubic-bezier(0,0,.58,1)": "ease-out",
|
|
297
|
+
"cubic-bezier(.42,0,.58,.42)": "ease-in-out"
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"transition-delay": {
|
|
301
|
+
keywords: [
|
|
302
|
+
],
|
|
303
|
+
"default": [
|
|
304
|
+
"0s"
|
|
305
|
+
],
|
|
306
|
+
types: [
|
|
307
|
+
"Time"
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
"transition-behavior": {
|
|
311
|
+
keywords: [
|
|
312
|
+
"normal",
|
|
313
|
+
"allow-discrete"
|
|
314
|
+
],
|
|
315
|
+
"default": [
|
|
316
|
+
"normal"
|
|
317
|
+
],
|
|
318
|
+
types: [
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"transition-property": {
|
|
324
|
+
shorthand: "transition"
|
|
325
|
+
},
|
|
326
|
+
"transition-duration": {
|
|
327
|
+
shorthand: "transition"
|
|
328
|
+
},
|
|
329
|
+
"transition-timing-function": {
|
|
330
|
+
shorthand: "transition"
|
|
331
|
+
},
|
|
332
|
+
"transition-delay": {
|
|
333
|
+
shorthand: "transition"
|
|
334
|
+
},
|
|
335
|
+
"transition-behavior": {
|
|
336
|
+
shorthand: "transition"
|
|
337
|
+
},
|
|
338
|
+
animation: {
|
|
339
|
+
shorthand: "animation",
|
|
340
|
+
pattern: "animation-name animation-duration animation-timing-function animation-delay animation-iteration-count animation-direction animation-fill-mode animation-play-state animation-timeline",
|
|
341
|
+
"default": [
|
|
342
|
+
"1",
|
|
343
|
+
"0s",
|
|
344
|
+
"0ms",
|
|
345
|
+
"none",
|
|
346
|
+
"ease",
|
|
347
|
+
"normal",
|
|
348
|
+
"running",
|
|
349
|
+
"auto"
|
|
350
|
+
],
|
|
351
|
+
properties: {
|
|
352
|
+
"animation-name": {
|
|
353
|
+
keywords: [
|
|
354
|
+
"none"
|
|
355
|
+
],
|
|
356
|
+
"default": [
|
|
357
|
+
"none"
|
|
358
|
+
],
|
|
359
|
+
types: [
|
|
360
|
+
"Iden"
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
"animation-duration": {
|
|
364
|
+
keywords: [
|
|
365
|
+
"auto"
|
|
366
|
+
],
|
|
367
|
+
"default": [
|
|
368
|
+
"0s",
|
|
369
|
+
"0ms",
|
|
370
|
+
"auto"
|
|
371
|
+
],
|
|
372
|
+
types: [
|
|
373
|
+
"Time"
|
|
374
|
+
],
|
|
375
|
+
mapping: {
|
|
376
|
+
auto: "0s"
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"animation-timing-function": {
|
|
380
|
+
keywords: [
|
|
381
|
+
"ease",
|
|
382
|
+
"ease-in",
|
|
383
|
+
"ease-out",
|
|
384
|
+
"ease-in-out",
|
|
385
|
+
"linear",
|
|
386
|
+
"step-start",
|
|
387
|
+
"step-end"
|
|
388
|
+
],
|
|
389
|
+
"default": [
|
|
390
|
+
"ease"
|
|
391
|
+
],
|
|
392
|
+
types: [
|
|
393
|
+
"TimingFunction"
|
|
394
|
+
],
|
|
395
|
+
mapping: {
|
|
396
|
+
"cubic-bezier(.25,.1,.25,1)": "ease",
|
|
397
|
+
"cubic-bezier(0,0,1,1)": "linear",
|
|
398
|
+
"cubic-bezier(.42,0,1,1)": "ease-in",
|
|
399
|
+
"cubic-bezier(0,0,.58,1)": "ease-out",
|
|
400
|
+
"cubic-bezier(.42,0,.58,.42)": "ease-in-out"
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
"animation-delay": {
|
|
404
|
+
keywords: [
|
|
405
|
+
],
|
|
406
|
+
"default": [
|
|
407
|
+
"0s",
|
|
408
|
+
"0ms"
|
|
409
|
+
],
|
|
410
|
+
types: [
|
|
411
|
+
"Time"
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
"animation-iteration-count": {
|
|
415
|
+
keywords: [
|
|
416
|
+
"infinite"
|
|
417
|
+
],
|
|
418
|
+
"default": [
|
|
419
|
+
"1"
|
|
420
|
+
],
|
|
421
|
+
types: [
|
|
422
|
+
"Number"
|
|
423
|
+
]
|
|
424
|
+
},
|
|
425
|
+
"animation-direction": {
|
|
426
|
+
keywords: [
|
|
427
|
+
"normal",
|
|
428
|
+
"reverse",
|
|
429
|
+
"alternate",
|
|
430
|
+
"alternate-reverse"
|
|
431
|
+
],
|
|
432
|
+
"default": [
|
|
433
|
+
"normal"
|
|
434
|
+
],
|
|
435
|
+
types: [
|
|
436
|
+
]
|
|
437
|
+
},
|
|
438
|
+
"animation-fill-mode": {
|
|
439
|
+
keywords: [
|
|
440
|
+
"none",
|
|
441
|
+
"forwards",
|
|
442
|
+
"backwards",
|
|
443
|
+
"both"
|
|
444
|
+
],
|
|
445
|
+
"default": [
|
|
446
|
+
"none"
|
|
447
|
+
],
|
|
448
|
+
types: [
|
|
449
|
+
]
|
|
450
|
+
},
|
|
451
|
+
"animation-play-state": {
|
|
452
|
+
keywords: [
|
|
453
|
+
"running",
|
|
454
|
+
"paused"
|
|
455
|
+
],
|
|
456
|
+
"default": [
|
|
457
|
+
"running"
|
|
458
|
+
],
|
|
459
|
+
types: [
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
"animation-timeline": {
|
|
463
|
+
keywords: [
|
|
464
|
+
"none",
|
|
465
|
+
"auto"
|
|
466
|
+
],
|
|
467
|
+
"default": [
|
|
468
|
+
"auto"
|
|
469
|
+
],
|
|
470
|
+
types: [
|
|
471
|
+
"DashedIden",
|
|
472
|
+
"TimelineFunction"
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"animation-name": {
|
|
478
|
+
shorthand: "animation"
|
|
479
|
+
},
|
|
480
|
+
"animation-duration": {
|
|
481
|
+
shorthand: "animation"
|
|
482
|
+
},
|
|
483
|
+
"animation-timing-function": {
|
|
484
|
+
shorthand: "animation"
|
|
485
|
+
},
|
|
486
|
+
"animation-delay": {
|
|
487
|
+
shorthand: "animation"
|
|
488
|
+
},
|
|
489
|
+
"animation-iteration-count": {
|
|
490
|
+
shorthand: "animation"
|
|
491
|
+
},
|
|
492
|
+
"animation-direction": {
|
|
493
|
+
shorthand: "animation"
|
|
494
|
+
},
|
|
495
|
+
"animation-fill-mode": {
|
|
496
|
+
shorthand: "animation"
|
|
497
|
+
},
|
|
498
|
+
"animation-play-state": {
|
|
499
|
+
shorthand: "animation"
|
|
500
|
+
},
|
|
501
|
+
"animation-timeline": {
|
|
502
|
+
shorthand: "animation"
|
|
503
|
+
},
|
|
504
|
+
"text-emphasis": {
|
|
505
|
+
shorthand: "text-emphasis",
|
|
506
|
+
pattern: "text-emphasis-color text-emphasis-style",
|
|
507
|
+
"default": [
|
|
508
|
+
"none",
|
|
509
|
+
"currentcolor"
|
|
510
|
+
],
|
|
511
|
+
properties: {
|
|
512
|
+
"text-emphasis-style": {
|
|
513
|
+
keywords: [
|
|
514
|
+
"none",
|
|
515
|
+
"filled",
|
|
516
|
+
"open",
|
|
517
|
+
"dot",
|
|
518
|
+
"circle",
|
|
519
|
+
"double-circle",
|
|
520
|
+
"triangle",
|
|
521
|
+
"sesame"
|
|
522
|
+
],
|
|
523
|
+
"default": [
|
|
524
|
+
"none"
|
|
525
|
+
],
|
|
526
|
+
types: [
|
|
527
|
+
"String"
|
|
528
|
+
]
|
|
529
|
+
},
|
|
530
|
+
"text-emphasis-color": {
|
|
531
|
+
"default": [
|
|
532
|
+
"currentcolor"
|
|
533
|
+
],
|
|
534
|
+
types: [
|
|
535
|
+
"Color"
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
"text-emphasis-style": {
|
|
541
|
+
shorthand: "text-emphasis"
|
|
542
|
+
},
|
|
543
|
+
"text-emphasis-color": {
|
|
544
|
+
shorthand: "text-emphasis"
|
|
545
|
+
},
|
|
235
546
|
border: {
|
|
236
547
|
shorthand: "border",
|
|
237
548
|
pattern: "border-color border-style border-width",
|
|
@@ -297,6 +608,75 @@ var map = {
|
|
|
297
608
|
"border-width": {
|
|
298
609
|
shorthand: "border"
|
|
299
610
|
},
|
|
611
|
+
"list-style": {
|
|
612
|
+
shorthand: "list-style",
|
|
613
|
+
pattern: "list-style-type list-style-position list-style-image",
|
|
614
|
+
keywords: [
|
|
615
|
+
"none",
|
|
616
|
+
"outside"
|
|
617
|
+
],
|
|
618
|
+
"default": [
|
|
619
|
+
"none",
|
|
620
|
+
"outside"
|
|
621
|
+
],
|
|
622
|
+
properties: {
|
|
623
|
+
"list-style-position": {
|
|
624
|
+
types: [
|
|
625
|
+
],
|
|
626
|
+
"default": [
|
|
627
|
+
"outside"
|
|
628
|
+
],
|
|
629
|
+
keywords: [
|
|
630
|
+
"inside",
|
|
631
|
+
"outside"
|
|
632
|
+
]
|
|
633
|
+
},
|
|
634
|
+
"list-style-image": {
|
|
635
|
+
"default": [
|
|
636
|
+
"none"
|
|
637
|
+
],
|
|
638
|
+
keywords: [
|
|
639
|
+
"node"
|
|
640
|
+
],
|
|
641
|
+
types: [
|
|
642
|
+
"UrlFunc",
|
|
643
|
+
"ImageFunc"
|
|
644
|
+
]
|
|
645
|
+
},
|
|
646
|
+
"list-style-type": {
|
|
647
|
+
types: [
|
|
648
|
+
"String",
|
|
649
|
+
"Iden",
|
|
650
|
+
"Symbols"
|
|
651
|
+
],
|
|
652
|
+
"default": [
|
|
653
|
+
"disc"
|
|
654
|
+
],
|
|
655
|
+
keywords: [
|
|
656
|
+
"disc",
|
|
657
|
+
"circle",
|
|
658
|
+
"square",
|
|
659
|
+
"decimal",
|
|
660
|
+
"decimal-leading-zero",
|
|
661
|
+
"lower-roman",
|
|
662
|
+
"upper-roman",
|
|
663
|
+
"lower-greek",
|
|
664
|
+
"lower-latin",
|
|
665
|
+
"upper-latin",
|
|
666
|
+
"none"
|
|
667
|
+
]
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
"list-style-position": {
|
|
672
|
+
shorthand: "list-style"
|
|
673
|
+
},
|
|
674
|
+
"list-style-image": {
|
|
675
|
+
shorthand: "list-style"
|
|
676
|
+
},
|
|
677
|
+
"list-style-type": {
|
|
678
|
+
shorthand: "list-style"
|
|
679
|
+
},
|
|
300
680
|
overflow: {
|
|
301
681
|
shorthand: "overflow",
|
|
302
682
|
pattern: "overflow-x overflow-y",
|
|
@@ -354,7 +734,8 @@ var map = {
|
|
|
354
734
|
],
|
|
355
735
|
"default": [
|
|
356
736
|
"0",
|
|
357
|
-
"none"
|
|
737
|
+
"none",
|
|
738
|
+
"currentcolor"
|
|
358
739
|
],
|
|
359
740
|
properties: {
|
|
360
741
|
"outline-color": {
|
|
@@ -362,10 +743,10 @@ var map = {
|
|
|
362
743
|
"Color"
|
|
363
744
|
],
|
|
364
745
|
"default": [
|
|
365
|
-
"
|
|
746
|
+
"currentcolor"
|
|
366
747
|
],
|
|
367
748
|
keywords: [
|
|
368
|
-
"
|
|
749
|
+
"currentcolor"
|
|
369
750
|
]
|
|
370
751
|
},
|
|
371
752
|
"outline-style": {
|
|
@@ -709,7 +1090,8 @@ var map = {
|
|
|
709
1090
|
},
|
|
710
1091
|
"background-image": {
|
|
711
1092
|
types: [
|
|
712
|
-
"UrlFunc"
|
|
1093
|
+
"UrlFunc",
|
|
1094
|
+
"ImageFunc"
|
|
713
1095
|
],
|
|
714
1096
|
"default": [
|
|
715
1097
|
"none"
|