@tbela99/css-parser 0.2.0 → 0.4.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/{LICENSE → LICENSE.md} +1 -1
- package/README.md +250 -77
- package/dist/config.json.js +245 -1
- package/dist/index-umd-web.js +4241 -1583
- package/dist/index.cjs +4242 -1584
- package/dist/index.d.ts +71 -23
- package/dist/lib/ast/expand.js +1 -1
- package/dist/lib/ast/features/calc.js +31 -192
- package/dist/lib/ast/features/index.js +3 -3
- package/dist/lib/ast/features/inlinecssvariables.js +6 -6
- package/dist/lib/ast/features/shorthand.js +5 -6
- package/dist/lib/ast/math/expression.js +220 -0
- package/dist/lib/ast/{features/utils → math}/math.js +4 -4
- package/dist/lib/ast/minify.js +0 -1
- package/dist/lib/ast/types.js +31 -13
- package/dist/lib/ast/utils/minifyfeature.js +4 -3
- package/dist/lib/ast/walk.js +24 -4
- package/dist/lib/fs/resolve.js +4 -3
- package/dist/lib/parser/declaration/list.js +6 -2
- package/dist/lib/parser/declaration/map.js +158 -24
- package/dist/lib/parser/declaration/set.js +42 -22
- package/dist/lib/parser/parse.js +345 -349
- package/dist/lib/parser/tokenize.js +220 -223
- package/dist/lib/parser/utils/declaration.js +67 -0
- package/dist/lib/parser/utils/syntax.js +172 -6
- package/dist/lib/parser/utils/type.js +2 -2
- package/dist/lib/renderer/color/a98rgb.js +64 -0
- package/dist/lib/renderer/color/color.js +521 -0
- package/dist/lib/renderer/color/colormix.js +337 -0
- package/dist/lib/renderer/color/hex.js +92 -0
- package/dist/lib/renderer/color/hsl.js +118 -0
- package/dist/lib/renderer/color/hsv.js +20 -0
- package/dist/lib/renderer/color/hwb.js +101 -0
- package/dist/lib/renderer/color/lab.js +136 -0
- package/dist/lib/renderer/color/lch.js +79 -0
- package/dist/lib/renderer/color/oklab.js +121 -0
- package/dist/lib/renderer/color/oklch.js +65 -0
- package/dist/lib/renderer/color/p3.js +57 -0
- package/dist/lib/renderer/color/prophotorgb.js +56 -0
- package/dist/lib/renderer/color/rec2020.js +70 -0
- package/dist/lib/renderer/color/relativecolor.js +152 -0
- package/dist/lib/renderer/color/rgb.js +44 -0
- package/dist/lib/renderer/color/srgb.js +261 -0
- package/dist/lib/renderer/color/utils/components.js +20 -0
- package/dist/lib/renderer/color/utils/constants.js +191 -0
- package/dist/lib/renderer/color/utils/matrix.js +35 -0
- package/dist/lib/renderer/color/xyz.js +64 -0
- package/dist/lib/renderer/color/xyzd50.js +33 -0
- package/dist/lib/renderer/render.js +128 -30
- package/dist/node/index.js +1 -1
- package/dist/node/load.js +1 -1
- package/dist/web/index.js +1 -1
- package/package.json +19 -18
- package/quickjs.sh +1 -0
- package/dist/lib/iterable/weakmap.js +0 -53
- package/dist/lib/renderer/utils/color.js +0 -499
- /package/dist/lib/iterable/{set.js → weakset.js} +0 -0
package/dist/config.json.js
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
var properties = {
|
|
2
|
+
gap: {
|
|
3
|
+
shorthand: "gap",
|
|
4
|
+
properties: [
|
|
5
|
+
"row-gap",
|
|
6
|
+
"column-gap"
|
|
7
|
+
],
|
|
8
|
+
types: [
|
|
9
|
+
"Length",
|
|
10
|
+
"Perc"
|
|
11
|
+
],
|
|
12
|
+
multiple: false,
|
|
13
|
+
separator: null,
|
|
14
|
+
keywords: [
|
|
15
|
+
"normal"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"row-gap": {
|
|
19
|
+
shorthand: "gap"
|
|
20
|
+
},
|
|
21
|
+
"column-gap": {
|
|
22
|
+
shorthand: "gap"
|
|
23
|
+
},
|
|
2
24
|
inset: {
|
|
3
25
|
shorthand: "inset",
|
|
4
26
|
properties: [
|
|
@@ -232,6 +254,201 @@ var properties = {
|
|
|
232
254
|
}
|
|
233
255
|
};
|
|
234
256
|
var map = {
|
|
257
|
+
"flex-flow": {
|
|
258
|
+
shorthand: "flex-flow",
|
|
259
|
+
pattern: "flex-direction flex-wrap",
|
|
260
|
+
keywords: [
|
|
261
|
+
],
|
|
262
|
+
"default": [
|
|
263
|
+
"row",
|
|
264
|
+
"nowrap"
|
|
265
|
+
],
|
|
266
|
+
properties: {
|
|
267
|
+
"flex-direction": {
|
|
268
|
+
keywords: [
|
|
269
|
+
"row",
|
|
270
|
+
"row-reverse",
|
|
271
|
+
"column",
|
|
272
|
+
"column-reverse"
|
|
273
|
+
],
|
|
274
|
+
"default": [
|
|
275
|
+
"row"
|
|
276
|
+
],
|
|
277
|
+
types: [
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
"flex-wrap": {
|
|
281
|
+
keywords: [
|
|
282
|
+
"wrap",
|
|
283
|
+
"nowrap",
|
|
284
|
+
"wrap-reverse"
|
|
285
|
+
],
|
|
286
|
+
"default": [
|
|
287
|
+
"nowrap"
|
|
288
|
+
],
|
|
289
|
+
types: [
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"flex-direction": {
|
|
295
|
+
shorthand: "flex-flow"
|
|
296
|
+
},
|
|
297
|
+
"flex-wrap": {
|
|
298
|
+
shorthand: "flex-flow"
|
|
299
|
+
},
|
|
300
|
+
container: {
|
|
301
|
+
shorthand: "container",
|
|
302
|
+
pattern: "container-name container-type",
|
|
303
|
+
keywords: [
|
|
304
|
+
],
|
|
305
|
+
"default": [
|
|
306
|
+
],
|
|
307
|
+
properties: {
|
|
308
|
+
"container-name": {
|
|
309
|
+
required: true,
|
|
310
|
+
multiple: true,
|
|
311
|
+
keywords: [
|
|
312
|
+
"none"
|
|
313
|
+
],
|
|
314
|
+
"default": [
|
|
315
|
+
"none"
|
|
316
|
+
],
|
|
317
|
+
types: [
|
|
318
|
+
"Iden",
|
|
319
|
+
"DashedIden"
|
|
320
|
+
]
|
|
321
|
+
},
|
|
322
|
+
"container-type": {
|
|
323
|
+
previous: "container-name",
|
|
324
|
+
prefix: {
|
|
325
|
+
typ: "Literal",
|
|
326
|
+
val: "/"
|
|
327
|
+
},
|
|
328
|
+
keywords: [
|
|
329
|
+
"size",
|
|
330
|
+
"inline-size",
|
|
331
|
+
"normal"
|
|
332
|
+
],
|
|
333
|
+
"default": [
|
|
334
|
+
"normal"
|
|
335
|
+
],
|
|
336
|
+
types: [
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"container-name": {
|
|
342
|
+
shorthand: "container"
|
|
343
|
+
},
|
|
344
|
+
"container-type": {
|
|
345
|
+
shorthand: "container"
|
|
346
|
+
},
|
|
347
|
+
flex: {
|
|
348
|
+
shorthand: "flex",
|
|
349
|
+
pattern: "flex-grow flex-shrink flex-basis",
|
|
350
|
+
keywords: [
|
|
351
|
+
"auto",
|
|
352
|
+
"none",
|
|
353
|
+
"initial"
|
|
354
|
+
],
|
|
355
|
+
"default": [
|
|
356
|
+
"0",
|
|
357
|
+
"0 1",
|
|
358
|
+
"0 auto",
|
|
359
|
+
"0 1 auto"
|
|
360
|
+
],
|
|
361
|
+
properties: {
|
|
362
|
+
"flex-grow": {
|
|
363
|
+
required: true,
|
|
364
|
+
keywords: [
|
|
365
|
+
],
|
|
366
|
+
"default": [
|
|
367
|
+
"0"
|
|
368
|
+
],
|
|
369
|
+
types: [
|
|
370
|
+
"Number"
|
|
371
|
+
]
|
|
372
|
+
},
|
|
373
|
+
"flex-shrink": {
|
|
374
|
+
keywords: [
|
|
375
|
+
],
|
|
376
|
+
"default": [
|
|
377
|
+
"1"
|
|
378
|
+
],
|
|
379
|
+
types: [
|
|
380
|
+
"Number"
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
"flex-basis": {
|
|
384
|
+
keywords: [
|
|
385
|
+
"max-content",
|
|
386
|
+
"min-content",
|
|
387
|
+
"fit-content",
|
|
388
|
+
"fit-content",
|
|
389
|
+
"content",
|
|
390
|
+
"auto"
|
|
391
|
+
],
|
|
392
|
+
"default": [
|
|
393
|
+
"auto"
|
|
394
|
+
],
|
|
395
|
+
types: [
|
|
396
|
+
"Length",
|
|
397
|
+
"Perc"
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
"flex-grow": {
|
|
403
|
+
shorthand: "flex"
|
|
404
|
+
},
|
|
405
|
+
"flex-shrink": {
|
|
406
|
+
shorthand: "flex"
|
|
407
|
+
},
|
|
408
|
+
"flex-basis": {
|
|
409
|
+
shorthand: "flex"
|
|
410
|
+
},
|
|
411
|
+
columns: {
|
|
412
|
+
shorthand: "columns",
|
|
413
|
+
pattern: "column-count column-width",
|
|
414
|
+
keywords: [
|
|
415
|
+
"auto"
|
|
416
|
+
],
|
|
417
|
+
"default": [
|
|
418
|
+
"auto",
|
|
419
|
+
"auto auto"
|
|
420
|
+
],
|
|
421
|
+
properties: {
|
|
422
|
+
"column-count": {
|
|
423
|
+
keywords: [
|
|
424
|
+
"auto"
|
|
425
|
+
],
|
|
426
|
+
"default": [
|
|
427
|
+
"auto"
|
|
428
|
+
],
|
|
429
|
+
types: [
|
|
430
|
+
"Number"
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
"column-width": {
|
|
434
|
+
keywords: [
|
|
435
|
+
"auto"
|
|
436
|
+
],
|
|
437
|
+
"default": [
|
|
438
|
+
"auto"
|
|
439
|
+
],
|
|
440
|
+
types: [
|
|
441
|
+
"Length"
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
"column-count": {
|
|
447
|
+
shorthand: "columns"
|
|
448
|
+
},
|
|
449
|
+
"column-width": {
|
|
450
|
+
shorthand: "columns"
|
|
451
|
+
},
|
|
235
452
|
transition: {
|
|
236
453
|
shorthand: "transition",
|
|
237
454
|
multiple: true,
|
|
@@ -249,6 +466,13 @@ var map = {
|
|
|
249
466
|
"none",
|
|
250
467
|
"normal"
|
|
251
468
|
],
|
|
469
|
+
mapping: {
|
|
470
|
+
"cubic-bezier(.25,.1,.25,1)": "ease",
|
|
471
|
+
"cubic-bezier(0,0,1,1)": "linear",
|
|
472
|
+
"cubic-bezier(.42,0,1,1)": "ease-in",
|
|
473
|
+
"cubic-bezier(0,0,.58,1)": "ease-out",
|
|
474
|
+
"cubic-bezier(.42,0,.58,.42)": "ease-in-out"
|
|
475
|
+
},
|
|
252
476
|
properties: {
|
|
253
477
|
"transition-property": {
|
|
254
478
|
keywords: [
|
|
@@ -256,6 +480,7 @@ var map = {
|
|
|
256
480
|
"all"
|
|
257
481
|
],
|
|
258
482
|
"default": [
|
|
483
|
+
"all"
|
|
259
484
|
],
|
|
260
485
|
types: [
|
|
261
486
|
"Iden"
|
|
@@ -699,6 +924,8 @@ var map = {
|
|
|
699
924
|
"overflow-x": {
|
|
700
925
|
"default": [
|
|
701
926
|
],
|
|
927
|
+
types: [
|
|
928
|
+
],
|
|
702
929
|
keywords: [
|
|
703
930
|
"auto",
|
|
704
931
|
"visible",
|
|
@@ -710,6 +937,8 @@ var map = {
|
|
|
710
937
|
"overflow-y": {
|
|
711
938
|
"default": [
|
|
712
939
|
],
|
|
940
|
+
types: [
|
|
941
|
+
],
|
|
713
942
|
keywords: [
|
|
714
943
|
"auto",
|
|
715
944
|
"visible",
|
|
@@ -1042,13 +1271,27 @@ var map = {
|
|
|
1042
1271
|
},
|
|
1043
1272
|
background: {
|
|
1044
1273
|
shorthand: "background",
|
|
1045
|
-
pattern: "background-
|
|
1274
|
+
pattern: "background-attachment background-origin background-clip background-color background-image background-repeat background-position background-size",
|
|
1046
1275
|
keywords: [
|
|
1047
1276
|
"none"
|
|
1048
1277
|
],
|
|
1049
1278
|
"default": [
|
|
1279
|
+
"0 0",
|
|
1280
|
+
"none",
|
|
1281
|
+
"auto",
|
|
1282
|
+
"repeat",
|
|
1283
|
+
"transparent",
|
|
1284
|
+
"#0000",
|
|
1285
|
+
"scroll",
|
|
1286
|
+
"padding-box",
|
|
1287
|
+
"border-box"
|
|
1050
1288
|
],
|
|
1051
1289
|
multiple: true,
|
|
1290
|
+
set: {
|
|
1291
|
+
"background-origin": [
|
|
1292
|
+
"background-clip"
|
|
1293
|
+
]
|
|
1294
|
+
},
|
|
1052
1295
|
separator: {
|
|
1053
1296
|
typ: "Comma"
|
|
1054
1297
|
},
|
|
@@ -1082,6 +1325,7 @@ var map = {
|
|
|
1082
1325
|
"Color"
|
|
1083
1326
|
],
|
|
1084
1327
|
"default": [
|
|
1328
|
+
"#0000",
|
|
1085
1329
|
"transparent"
|
|
1086
1330
|
],
|
|
1087
1331
|
multiple: true,
|