@tbela99/css-parser 1.1.0 → 1.1.1

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.
@@ -60,7 +60,7 @@ var declarations = {
60
60
  syntax: "auto | after"
61
61
  },
62
62
  "-ms-overflow-style": {
63
- syntax: "auto | none | scrollbar | -ms-autohiding-scrollbar"
63
+ syntax: "auto | none | scrollbar | -ms-autohiding-scrollbar auto | none | scrollbar | -ms-autohiding-scrollbar"
64
64
  },
65
65
  "-ms-scroll-chaining": {
66
66
  syntax: "chained | none"
@@ -170,9 +170,6 @@ var declarations = {
170
170
  "-moz-force-broken-image-icon": {
171
171
  syntax: "0 | 1"
172
172
  },
173
- "-moz-image-region": {
174
- syntax: "<shape> | auto"
175
- },
176
173
  "-moz-orient": {
177
174
  syntax: "inline | block | horizontal | vertical"
178
175
  },
@@ -213,7 +210,7 @@ var declarations = {
213
210
  syntax: "default | menu | tooltip | sheet | none"
214
211
  },
215
212
  "-webkit-appearance": {
216
- syntax: "none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button"
213
+ syntax: "none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button none | button | button-bevel | caps-lock-indicator | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbargripper-horizontal | scrollbargripper-vertical | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button"
217
214
  },
218
215
  "-webkit-border-before": {
219
216
  syntax: "<'border-width'> || <'border-style'> || <color>"
@@ -297,7 +294,7 @@ var declarations = {
297
294
  syntax: "read-only | read-write | read-write-plaintext-only"
298
295
  },
299
296
  "-webkit-user-select": {
300
- syntax: "auto | text | none | all"
297
+ syntax: "auto | text | none | all auto | none | text | all"
301
298
  },
302
299
  "accent-color": {
303
300
  syntax: "auto | <color>"
@@ -315,7 +312,7 @@ var declarations = {
315
312
  syntax: "[ normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position> ]#"
316
313
  },
317
314
  "alignment-baseline": {
318
- syntax: "baseline | alphabetic | ideographic | middle | central | mathematical | text-before-edge | text-after-edge"
315
+ syntax: "baseline | alphabetic | ideographic | middle | central | mathematical | text-before-edge | text-after-edge auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical"
319
316
  },
320
317
  all: {
321
318
  syntax: "initial | inherit | unset | revert | revert-layer"
@@ -339,7 +336,7 @@ var declarations = {
339
336
  syntax: "<single-animation-direction>#"
340
337
  },
341
338
  "animation-duration": {
342
- syntax: "<time>#"
339
+ syntax: "[ auto | <time [0s,∞]> ]#"
343
340
  },
344
341
  "animation-fill-mode": {
345
342
  syntax: "<single-animation-fill-mode>#"
@@ -417,7 +414,7 @@ var declarations = {
417
414
  syntax: "<bg-size>#"
418
415
  },
419
416
  "baseline-shift": {
420
- syntax: "<length-percentage> | sub | super | baseline"
417
+ syntax: "<length-percentage> | sub | super | baseline baseline | sub | super | <svg-length>"
421
418
  },
422
419
  "block-size": {
423
420
  syntax: "<'width'>"
@@ -756,7 +753,7 @@ var declarations = {
756
753
  syntax: "[ <counter-name> <integer>? ]+ | none"
757
754
  },
758
755
  cursor: {
759
- syntax: "[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ]"
756
+ syntax: "[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ] [ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing | hand | -webkit-grab | -webkit-grabbing | -webkit-zoom-in | -webkit-zoom-out | -moz-grab | -moz-grabbing | -moz-zoom-in | -moz-zoom-out ] ]"
760
757
  },
761
758
  cx: {
762
759
  syntax: "<length> | <percentage>"
@@ -771,10 +768,10 @@ var declarations = {
771
768
  syntax: "ltr | rtl"
772
769
  },
773
770
  display: {
774
- syntax: "[ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>| <-non-standard-display>"
771
+ syntax: "[ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy> | <-non-standard-display>"
775
772
  },
776
773
  "dominant-baseline": {
777
- syntax: "auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top"
774
+ syntax: "auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge"
778
775
  },
779
776
  "empty-cells": {
780
777
  syntax: "show | hide"
@@ -786,13 +783,13 @@ var declarations = {
786
783
  syntax: "<paint>"
787
784
  },
788
785
  "fill-opacity": {
789
- syntax: "<'opacity'>"
786
+ syntax: "<'opacity'> <number-zero-one>"
790
787
  },
791
788
  "fill-rule": {
792
789
  syntax: "nonzero | evenodd"
793
790
  },
794
791
  filter: {
795
- syntax: "none | <filter-value-list>"
792
+ syntax: "none | <filter-value-list> | <-ms-filter-function-list>"
796
793
  },
797
794
  flex: {
798
795
  syntax: "none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]"
@@ -825,7 +822,7 @@ var declarations = {
825
822
  syntax: "<'opacity'>"
826
823
  },
827
824
  font: {
828
- syntax: "[ [ <'font-style'> || <font-variant-css2> || <'font-weight'> || <font-width-css3> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'># ] | <system-family-name>"
825
+ syntax: "[ [ <'font-style'> || <font-variant-css2> || <'font-weight'> || <font-width-css3> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'># ] | <system-family-name> [ [ <'font-style'> || <font-variant-css2> || <'font-weight'> || <font-width-css3> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'># ] | <system-family-name> | <-non-standard-font>"
829
826
  },
830
827
  "font-family": {
831
828
  syntax: "[ <family-name> | <generic-family> ]#"
@@ -972,7 +969,7 @@ var declarations = {
972
969
  syntax: "none | [ first || [ force-end | allow-end ] || last ]"
973
970
  },
974
971
  height: {
975
- syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>"
972
+ syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | <-non-standard-size>"
976
973
  },
977
974
  "hyphenate-character": {
978
975
  syntax: "auto | <string>"
@@ -987,7 +984,7 @@ var declarations = {
987
984
  syntax: "from-image | <angle> | [ <angle>? flip ]"
988
985
  },
989
986
  "image-rendering": {
990
- syntax: "auto | crisp-edges | pixelated | smooth| optimizeSpeed | optimizeQuality | <-non-standard-image-rendering>"
987
+ syntax: "auto | crisp-edges | pixelated | smooth | optimizeSpeed | optimizeQuality | <-non-standard-image-rendering>"
991
988
  },
992
989
  "image-resolution": {
993
990
  syntax: "[ from-image || <resolution> ] && snap?"
@@ -1047,7 +1044,7 @@ var declarations = {
1047
1044
  syntax: "<length> | <percentage> | auto"
1048
1045
  },
1049
1046
  "letter-spacing": {
1050
- syntax: "normal | <length>"
1047
+ syntax: "normal | <length> normal | <length-percentage>"
1051
1048
  },
1052
1049
  "lighting-color": {
1053
1050
  syntax: "<color>"
@@ -1191,7 +1188,7 @@ var declarations = {
1191
1188
  syntax: "<'max-width'>"
1192
1189
  },
1193
1190
  "max-height": {
1194
- syntax: "none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>"
1191
+ syntax: "none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | <-non-standard-size>"
1195
1192
  },
1196
1193
  "max-inline-size": {
1197
1194
  syntax: "<'max-width'>"
@@ -1200,19 +1197,19 @@ var declarations = {
1200
1197
  syntax: "none | <integer>"
1201
1198
  },
1202
1199
  "max-width": {
1203
- syntax: "none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>"
1200
+ syntax: "none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | <-non-standard-size>"
1204
1201
  },
1205
1202
  "min-block-size": {
1206
1203
  syntax: "<'min-width'>"
1207
1204
  },
1208
1205
  "min-height": {
1209
- syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>"
1206
+ syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | <-non-standard-size>"
1210
1207
  },
1211
1208
  "min-inline-size": {
1212
1209
  syntax: "<'min-width'>"
1213
1210
  },
1214
1211
  "min-width": {
1215
- syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>"
1212
+ syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | <-non-standard-size>"
1216
1213
  },
1217
1214
  "mix-blend-mode": {
1218
1215
  syntax: "<blend-mode> | plus-lighter"
@@ -1269,7 +1266,7 @@ var declarations = {
1269
1266
  syntax: "<line-width>"
1270
1267
  },
1271
1268
  overflow: {
1272
- syntax: "[ visible | hidden | clip | scroll | auto ]{1,2}"
1269
+ syntax: "[ visible | hidden | clip | scroll | auto ]{1,2} | <-non-standard-overflow>"
1273
1270
  },
1274
1271
  "overflow-anchor": {
1275
1272
  syntax: "auto | none"
@@ -1290,10 +1287,10 @@ var declarations = {
1290
1287
  syntax: "normal | break-word | anywhere"
1291
1288
  },
1292
1289
  "overflow-x": {
1293
- syntax: "visible | hidden | clip | scroll | auto"
1290
+ syntax: "visible | hidden | clip | scroll | auto | <-non-standard-overflow>"
1294
1291
  },
1295
1292
  "overflow-y": {
1296
- syntax: "visible | hidden | clip | scroll | auto"
1293
+ syntax: "visible | hidden | clip | scroll | auto | <-non-standard-overflow>"
1297
1294
  },
1298
1295
  overlay: {
1299
1296
  syntax: "none | auto"
@@ -1380,7 +1377,7 @@ var declarations = {
1380
1377
  syntax: "auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit"
1381
1378
  },
1382
1379
  position: {
1383
- syntax: "static | relative | absolute | sticky | fixed| -webkit-sticky"
1380
+ syntax: "static | relative | absolute | sticky | fixed | -webkit-sticky"
1384
1381
  },
1385
1382
  "position-anchor": {
1386
1383
  syntax: "auto | <anchor-name>"
@@ -1587,25 +1584,25 @@ var declarations = {
1587
1584
  syntax: "<color>"
1588
1585
  },
1589
1586
  "stroke-dasharray": {
1590
- syntax: "none | <dasharray>"
1587
+ syntax: "none | <dasharray> none | [ <svg-length>+ ]#"
1591
1588
  },
1592
1589
  "stroke-dashoffset": {
1593
- syntax: "<length-percentage> | <number>"
1590
+ syntax: "<length-percentage> | <number> <svg-length>"
1594
1591
  },
1595
1592
  "stroke-linecap": {
1596
1593
  syntax: "butt | round | square"
1597
1594
  },
1598
1595
  "stroke-linejoin": {
1599
- syntax: "miter | miter-clip | round | bevel | arcs"
1596
+ syntax: "miter | miter-clip | round | bevel | arcs miter | round | bevel"
1600
1597
  },
1601
1598
  "stroke-miterlimit": {
1602
- syntax: "<number>"
1599
+ syntax: "<number> <number-one-or-greater>"
1603
1600
  },
1604
1601
  "stroke-opacity": {
1605
1602
  syntax: "<'opacity'>"
1606
1603
  },
1607
1604
  "stroke-width": {
1608
- syntax: "<length-percentage> | <number>"
1605
+ syntax: "<length-percentage> | <number> <svg-length>"
1609
1606
  },
1610
1607
  "tab-size": {
1611
1608
  syntax: "<integer> | <length>"
@@ -1614,7 +1611,7 @@ var declarations = {
1614
1611
  syntax: "auto | fixed"
1615
1612
  },
1616
1613
  "text-align": {
1617
- syntax: "start | end | left | right | center | justify | match-parent"
1614
+ syntax: "start | end | left | right | center | justify | match-parent | <-non-standard-text-align>"
1618
1615
  },
1619
1616
  "text-align-last": {
1620
1617
  syntax: "auto | start | end | left | right | center | justify"
@@ -1752,7 +1749,7 @@ var declarations = {
1752
1749
  syntax: "none | <length-percentage> [ <length-percentage> <length>? ]?"
1753
1750
  },
1754
1751
  "unicode-bidi": {
1755
- syntax: "normal | embed | isolate | bidi-override | isolate-override | plaintext"
1752
+ syntax: "normal | embed | isolate | bidi-override | isolate-override | plaintext | -moz-isolate | -moz-isolate-override | -moz-plaintext | -webkit-isolate | -webkit-isolate-override | -webkit-plaintext"
1756
1753
  },
1757
1754
  "user-select": {
1758
1755
  syntax: "auto | text | none | all"
@@ -1794,7 +1791,7 @@ var declarations = {
1794
1791
  syntax: "<integer>"
1795
1792
  },
1796
1793
  width: {
1797
- syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>"
1794
+ syntax: "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | <-non-standard-size>"
1798
1795
  },
1799
1796
  "will-change": {
1800
1797
  syntax: "auto | <animateable-feature>#"
@@ -1809,7 +1806,7 @@ var declarations = {
1809
1806
  syntax: "normal | break-word"
1810
1807
  },
1811
1808
  "writing-mode": {
1812
- syntax: "horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr"
1809
+ syntax: "horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr | <svg-writing-mode>"
1813
1810
  },
1814
1811
  x: {
1815
1812
  syntax: "<length> | <percentage>"
@@ -1845,7 +1842,7 @@ var declarations = {
1845
1842
  syntax: "auto | grayscale"
1846
1843
  },
1847
1844
  "-moz-user-select": {
1848
- syntax: "none | text | all | -moz-none"
1845
+ syntax: "none | text | all | -moz-none | auto"
1849
1846
  },
1850
1847
  "-ms-flex-align": {
1851
1848
  syntax: "start | end | center | baseline | stretch"
@@ -2452,10 +2449,10 @@ var syntaxes = {
2452
2449
  syntax: "<url>"
2453
2450
  },
2454
2451
  color: {
2455
- syntax: "<color-base> | currentColor | <system-color> | <light-dark()> | <deprecated-system-color>"
2452
+ syntax: "<color-base> | currentColor | <system-color> | <device-cmyk()> | <light-dark()> | <-non-standard-color>"
2456
2453
  },
2457
2454
  "color()": {
2458
- syntax: "color( [ from <color> ]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )"
2455
+ syntax: "color( <colorspace-params> [ / [ <alpha-value> | none ] ]? )"
2459
2456
  },
2460
2457
  "color-base": {
2461
2458
  syntax: "<hex-color> | <color-function> | <named-color> | <color-mix()> | transparent"
@@ -2467,7 +2464,7 @@ var syntaxes = {
2467
2464
  syntax: "in [ <rectangular-color-space> | <polar-color-space> <hue-interpolation-method>? | <custom-color-space> ]"
2468
2465
  },
2469
2466
  "color-mix()": {
2470
- syntax: "color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2})"
2467
+ syntax: "color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2} )"
2471
2468
  },
2472
2469
  "color-stop": {
2473
2470
  syntax: "<color-stop-length> | <color-stop-angle>"
@@ -2482,10 +2479,10 @@ var syntaxes = {
2482
2479
  syntax: "<linear-color-stop> , [ <linear-color-hint>? , <linear-color-stop> ]#?"
2483
2480
  },
2484
2481
  "colorspace-params": {
2485
- syntax: "[<custom-params> | <predefined-rgb-params> | <xyz-params>]"
2482
+ syntax: "[ <predefined-rgb-params> | <xyz-params>]"
2486
2483
  },
2487
2484
  combinator: {
2488
- syntax: "'>' | '+' | '~' | [ '||' ]"
2485
+ syntax: "'>' | '+' | '~' | [ '|' '|' ]"
2489
2486
  },
2490
2487
  "common-lig-values": {
2491
2488
  syntax: "[ common-ligatures | no-common-ligatures ]"
@@ -2494,7 +2491,7 @@ var syntaxes = {
2494
2491
  syntax: "searchfield | textarea | push-button | slider-horizontal | checkbox | radio | square-button | menulist | listbox | meter | progress-bar | button"
2495
2492
  },
2496
2493
  "complex-selector": {
2497
- syntax: "<compound-selector> [ <combinator>? <compound-selector> ]*"
2494
+ syntax: "<complex-selector-unit> [ <combinator>? <complex-selector-unit> ]*"
2498
2495
  },
2499
2496
  "complex-selector-list": {
2500
2497
  syntax: "<complex-selector>#"
@@ -2506,7 +2503,7 @@ var syntaxes = {
2506
2503
  syntax: "add | subtract | intersect | exclude"
2507
2504
  },
2508
2505
  "compound-selector": {
2509
- syntax: "[ <type-selector>? <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!"
2506
+ syntax: "[ <type-selector>? <subclass-selector>* ]!"
2510
2507
  },
2511
2508
  "compound-selector-list": {
2512
2509
  syntax: "<compound-selector>#"
@@ -2518,7 +2515,7 @@ var syntaxes = {
2518
2515
  syntax: "[ [ [ from [ <angle> | <zero> ] ]? [ at <position> ]? ] || <color-interpolation-method> ]? , <angular-color-stop-list>"
2519
2516
  },
2520
2517
  "container-condition": {
2521
- syntax: "[ <container-name>? <container-query>? ]!"
2518
+ syntax: "not <query-in-parens> | <query-in-parens> [ [ and <query-in-parens> ]* | [ or <query-in-parens> ]* ]"
2522
2519
  },
2523
2520
  "container-name": {
2524
2521
  syntax: "<custom-ident>"
@@ -2530,7 +2527,7 @@ var syntaxes = {
2530
2527
  syntax: "space-between | space-around | space-evenly | stretch"
2531
2528
  },
2532
2529
  "content-list": {
2533
- syntax: "[ <string> | contents | <image> | <counter> | <quote> | <target> | <leader()> ]+"
2530
+ syntax: "[ <string> | contents | <image> | <counter> | <quote> | <target> | <leader()> | <attr()> ]+"
2534
2531
  },
2535
2532
  "content-position": {
2536
2533
  syntax: "center | start | end | flex-start | flex-end"
@@ -2545,7 +2542,7 @@ var syntaxes = {
2545
2542
  syntax: "contrast( [ <number> | <percentage> ]? )"
2546
2543
  },
2547
2544
  "coord-box": {
2548
- syntax: "<paint-box> | view-box"
2545
+ syntax: "content-box | padding-box | border-box | fill-box | stroke-box | view-box"
2549
2546
  },
2550
2547
  "cos()": {
2551
2548
  syntax: "cos( <calc-sum> )"
@@ -2575,7 +2572,7 @@ var syntaxes = {
2575
2572
  syntax: "cubic-bezier( [ <number [0,1]>, <number> ]#{2} )"
2576
2573
  },
2577
2574
  "cubic-bezier-easing-function": {
2578
- syntax: "ease | ease-in | ease-out | ease-in-out | <cubic-bezier()>"
2575
+ syntax: "ease | ease-in | ease-out | ease-in-out | cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )"
2579
2576
  },
2580
2577
  "custom-color-space": {
2581
2578
  syntax: "<dashed-ident>"
@@ -2626,7 +2623,7 @@ var syntaxes = {
2626
2623
  syntax: "[ full-width | proportional-width ]"
2627
2624
  },
2628
2625
  "element()": {
2629
- syntax: "element( <id-selector> )"
2626
+ syntax: "element( <custom-ident> , [ first | start | last | first-except ]? ) | element( <id-selector> )"
2630
2627
  },
2631
2628
  "ellipse()": {
2632
2629
  syntax: "ellipse( <radial-size>? [ at <position> ]? )"
@@ -2707,10 +2704,10 @@ var syntaxes = {
2707
2704
  syntax: "serif | sans-serif | system-ui | cursive | fantasy | math | monospace"
2708
2705
  },
2709
2706
  "general-enclosed": {
2710
- syntax: "[ <function-token> <any-value> ) ] | ( <ident> <any-value> )"
2707
+ syntax: "[ <function-token> <any-value>? ) ] | [ ( <any-value>? ) ]"
2711
2708
  },
2712
2709
  "generic-family": {
2713
- syntax: "<generic-complete> | <generic-incomplete> | emoji | fangsong"
2710
+ syntax: "<generic-script-specific>| <generic-complete> | <generic-incomplete> | <-non-standard-generic-family>"
2714
2711
  },
2715
2712
  "generic-incomplete": {
2716
2713
  syntax: "ui-serif | ui-sans-serif | ui-monospace | ui-rounded"
@@ -2719,7 +2716,7 @@ var syntaxes = {
2719
2716
  syntax: "<shape-box> | fill-box | stroke-box | view-box"
2720
2717
  },
2721
2718
  gradient: {
2722
- syntax: "<linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()> | <repeating-conic-gradient()>"
2719
+ syntax: "| <-legacy-gradient>"
2723
2720
  },
2724
2721
  "grayscale()": {
2725
2722
  syntax: "grayscale( [ <number> | <percentage> ]? )"
@@ -3007,7 +3004,7 @@ var syntaxes = {
3007
3004
  syntax: "A5 | A4 | A3 | B5 | B4 | JIS-B5 | JIS-B4 | letter | legal | ledger"
3008
3005
  },
3009
3006
  paint: {
3010
- syntax: "none | <color> | <url> [none | <color>]? | context-fill | context-stroke"
3007
+ syntax: "none | <color> | <url> [ none | <color> ]? | context-fill | context-stroke"
3011
3008
  },
3012
3009
  "paint()": {
3013
3010
  syntax: "paint( <ident>, <declaration-value>? )"
@@ -3037,7 +3034,7 @@ var syntaxes = {
3037
3034
  syntax: "[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]"
3038
3035
  },
3039
3036
  "position-area": {
3040
- syntax: "[ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ] || [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ] | [ block-start | center | block-end | span-block-start | span-block-end | span-all ] || [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ] | [ self-block-start | center | self-block-end | span-self-block-start | span-self-block-end | span-all ] || [ self-inline-start | center | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ] | [ start | center | end | span-start | span-end | span-all ]{1,2} | [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2}"
3037
+ syntax: "[ [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ] || [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ] | [ block-start | center | block-end | span-block-start | span-block-end | span-all ] || [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ] | [ self-block-start | center | self-block-end | span-self-block-start | span-self-block-end | span-all ] || [ self-inline-start | center | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ] | [ start | center | end | span-start | span-end | span-all ]{1,2} | [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2} ]"
3041
3038
  },
3042
3039
  "pow()": {
3043
3040
  syntax: "pow( <calc-sum>, <calc-sum> )"
@@ -3052,13 +3049,13 @@ var syntaxes = {
3052
3049
  syntax: "':' <ident-token> | ':' <function-token> <any-value> ')'"
3053
3050
  },
3054
3051
  "pseudo-element-selector": {
3055
- syntax: "':' <pseudo-class-selector>"
3052
+ syntax: "':' <pseudo-class-selector> | <legacy-pseudo-element-selector>"
3056
3053
  },
3057
3054
  "pseudo-page": {
3058
3055
  syntax: ": [ left | right | first | blank ]"
3059
3056
  },
3060
3057
  "query-in-parens": {
3061
- syntax: "( <container-query> ) | ( <size-feature> ) | style( <style-query> ) | scroll-state( <scroll-state-query> ) | <general-enclosed>"
3058
+ syntax: "( <container-condition> ) | ( <size-feature> ) | style( <style-query> ) | <general-enclosed>"
3062
3059
  },
3063
3060
  quote: {
3064
3061
  syntax: "open-quote | close-quote | no-open-quote | no-close-quote"
@@ -3166,10 +3163,10 @@ var syntaxes = {
3166
3163
  syntax: "scaleZ( [ <number> | <percentage> ] )"
3167
3164
  },
3168
3165
  "scope-end": {
3169
- syntax: "<selector-list>"
3166
+ syntax: "<forgiving-selector-list>"
3170
3167
  },
3171
3168
  "scope-start": {
3172
- syntax: "<selector-list>"
3169
+ syntax: "<forgiving-selector-list>"
3173
3170
  },
3174
3171
  "scroll()": {
3175
3172
  syntax: "scroll( [ <scroller> || <axis> ]? )"
@@ -3202,7 +3199,7 @@ var syntaxes = {
3202
3199
  syntax: "[ <length>{2,3} && <color>? ]"
3203
3200
  },
3204
3201
  shape: {
3205
- syntax: "rect(<top>, <right>, <bottom>, <left>)"
3202
+ syntax: "rect( <top>, <right>, <bottom>, <left> ) | rect( <top> <right> <bottom> <left> )"
3206
3203
  },
3207
3204
  "shape-box": {
3208
3205
  syntax: "<visual-box> | margin-box"
@@ -3253,7 +3250,7 @@ var syntaxes = {
3253
3250
  syntax: "closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}"
3254
3251
  },
3255
3252
  "size-feature": {
3256
- syntax: "<media-query-list>"
3253
+ syntax: "<mf-plain> | <mf-boolean> | <mf-range>"
3257
3254
  },
3258
3255
  "skew()": {
3259
3256
  syntax: "skew( [ <angle> | <zero> ] , [ <angle> | <zero> ]? )"
@@ -3280,10 +3277,10 @@ var syntaxes = {
3280
3277
  syntax: "<declaration>"
3281
3278
  },
3282
3279
  "style-in-parens": {
3283
- syntax: "( <style-query> ) | ( <style-feature> ) | <general-enclosed>"
3280
+ syntax: "( <style-condition> ) | ( <style-feature> ) | <general-enclosed>"
3284
3281
  },
3285
3282
  "style-query": {
3286
- syntax: "not <style-in-parens> | <style-in-parens> [ [ and <style-in-parens> ]* | [ or <style-in-parens> ]* ] | <style-feature> "
3283
+ syntax: "<style-condition> | <style-feature>"
3287
3284
  },
3288
3285
  "subclass-selector": {
3289
3286
  syntax: "<id-selector> | <class-selector> | <attribute-selector> | <pseudo-class-selector>"
@@ -3412,7 +3409,7 @@ var syntaxes = {
3412
3409
  syntax: "xyz | xyz-d50 | xyz-d65"
3413
3410
  },
3414
3411
  "xyz-params": {
3415
- syntax: "<xyz> [ <number> | <percentage> | none ]{3}"
3412
+ syntax: "<xyz-space> [ <number> | <percentage> | none ]{3}"
3416
3413
  },
3417
3414
  "-legacy-gradient": {
3418
3415
  syntax: "<-webkit-gradient()> | <-legacy-linear-gradient> | <-legacy-repeating-linear-gradient> | <-legacy-radial-gradient> | <-legacy-repeating-radial-gradient>"
@@ -3607,10 +3604,13 @@ var syntaxes = {
3607
3604
  syntax: "not <style-in-parens> | <style-in-parens> [ [ and <style-in-parens> ]* | [ or <style-in-parens> ]* ]"
3608
3605
  },
3609
3606
  "-non-standard-display": {
3610
- syntax: "-ms-inline-flexbox | -ms-grid | -ms-inline-grid | -webkit-flex | -webkit-inline-flex | -webkit-box | -webkit-inline-box | -moz-inline-stack | -moz-box | -moz-inline-box"
3607
+ syntax: "-ms-inline-flexbox | -ms-grid | -ms-inline-grid | -webkit-flex | -webkit-inline-flex | -webkit-box | -webkit-inline-box | -moz-inline-stack | -moz-box | -moz-inline-box | -ms-flexbox"
3611
3608
  },
3612
3609
  "inset-area": {
3613
3610
  syntax: "[ [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ] || [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ] | [ block-start | center | block-end | span-block-start | span-block-end | span-all ] || [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ] | [ self-block-start | self-block-end | span-self-block-start | span-self-block-end | span-all ] || [ self-inline-start | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ] | [ start | center | end | span-start | span-end | span-all ]{1,2} | [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2} ]"
3611
+ },
3612
+ "-non-standard-text-align": {
3613
+ syntax: "| -moz-center | -webkit-center | -webkit-match-parent"
3614
3614
  }
3615
3615
  };
3616
3616
  var selectors = {
@@ -1,20 +1,14 @@
1
1
  import { ValidationTokenEnum } from './types.js';
2
2
  import { isIdent, isPseudo } from '../../syntax/syntax.js';
3
+ import { getTokenType as getTokenType$1 } from '../../parser/parse.js';
4
+ import '../../parser/tokenize.js';
5
+ import '../../parser/utils/config.js';
6
+ import { EnumToken } from '../../ast/types.js';
7
+ import '../../ast/minify.js';
8
+ import '../../ast/walk.js';
9
+ import '../../renderer/color/utils/constants.js';
10
+ import '../../renderer/sourcemap/lib/encode.js';
3
11
 
4
- var WalkValidationTokenEnum;
5
- (function (WalkValidationTokenEnum) {
6
- WalkValidationTokenEnum[WalkValidationTokenEnum["IgnoreChildren"] = 0] = "IgnoreChildren";
7
- WalkValidationTokenEnum[WalkValidationTokenEnum["IgnoreNode"] = 1] = "IgnoreNode";
8
- WalkValidationTokenEnum[WalkValidationTokenEnum["IgnoreAll"] = 2] = "IgnoreAll";
9
- })(WalkValidationTokenEnum || (WalkValidationTokenEnum = {}));
10
- var WalkValidationTokenKeyTypeEnum;
11
- (function (WalkValidationTokenKeyTypeEnum) {
12
- WalkValidationTokenKeyTypeEnum["Array"] = "array";
13
- WalkValidationTokenKeyTypeEnum["Children"] = "chi";
14
- WalkValidationTokenKeyTypeEnum["Left"] = "l";
15
- WalkValidationTokenKeyTypeEnum["Right"] = "r";
16
- WalkValidationTokenKeyTypeEnum["Prelude"] = "prelude";
17
- })(WalkValidationTokenKeyTypeEnum || (WalkValidationTokenKeyTypeEnum = {}));
18
12
  const skipped = [
19
13
  ValidationTokenEnum.Star,
20
14
  ValidationTokenEnum.HashMark,
@@ -28,18 +22,6 @@ const objectProperties = {
28
22
  writable: true,
29
23
  configurable: true
30
24
  };
31
- // syntaxes: keyword | <'property'> | <function>
32
- // "none | [ [<dashed-ident> || <try-tactic>] | inset-area( <'inset-area'> ) ]#"
33
- // ""
34
- // : "<outline-radius>{1,4} [ / <outline-radius>{1,4} ]?
35
- // ""
36
- // false | true
37
- // [ <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || [ <box> | border | padding | content | text ] || [ <box> | border | padding | content ] ]#
38
- // false | true | green | pipe
39
- // keyword | <'property'> | <function>
40
- // [<dashed-ident> || <try-tactic>]
41
- // [ <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || [ <box> | border | padding | content | text ] || [ <box> | border | padding | content ] ]#
42
- // none | [ [<dashed-ident> || <try-tactic>] | inset-area( <'inset-area'> ) ]
43
25
  function* tokenize(syntax, position = { ind: 0, lin: 1, col: 0 }, currentPosition = {
44
26
  ind: -1,
45
27
  lin: 1,
@@ -202,7 +184,6 @@ function matchParens(syntax, iterator) {
202
184
  let items = [];
203
185
  let match = 0;
204
186
  while ((item = iterator.next()) && !item.done) {
205
- // console.error(JSON.stringify({match, val: item.value,func}, null, 1));
206
187
  switch (item.value.typ) {
207
188
  case ValidationTokenEnum.OpenParenthesis:
208
189
  if (match > 0) {
@@ -878,7 +859,7 @@ function getTokenType(token, position, currentPosition) {
878
859
  if (token.startsWith('<')) {
879
860
  // <number [1,1000]>
880
861
  // <length [0,∞]>
881
- let match = token.match(/<([a-z0-9-]+)(\s+\[([0-9]+),(([0-9]+)|∞)\])?>/);
862
+ let match = token.match(/<([a-z0-9-]+)(\s+\[([0-9]+[a-zA-Z]*),(([0-9]+[a-zA-Z]*)|∞)\])?>/);
882
863
  if (match == null) {
883
864
  let match = token.match(/<([a-zA-Z0-9-]+)\(\)>/);
884
865
  if (match != null) {
@@ -890,10 +871,12 @@ function getTokenType(token, position, currentPosition) {
890
871
  throw new Error('invalid token at position: ' + position.lin + ':' + position.col + ' ' + token);
891
872
  }
892
873
  if (match[2] != null) {
874
+ const type = getTokenType$1(match[3]);
893
875
  return Object.defineProperty({
894
876
  typ: ValidationTokenEnum.PropertyType,
895
877
  val: match[1],
896
- range: [+match[3], match[4] == '\u221e' ? Infinity : +match[4]]
878
+ unit: EnumToken[type.typ],
879
+ range: [+type.val, match[4] == '\u221e' ? null : +match[4]]
897
880
  }, 'pos', { ...objectProperties, value: pos });
898
881
  }
899
882
  return Object.defineProperty({
@@ -964,7 +947,7 @@ function renderSyntax(token, parent) {
964
947
  case ValidationTokenEnum.Bracket:
965
948
  return '[' + token.chi.reduce((acc, curr) => acc + renderSyntax(curr), '') + ']' + renderAttributes(token);
966
949
  case ValidationTokenEnum.PropertyType:
967
- return '<' + token.val + '>' + renderAttributes(token);
950
+ return '<' + token.val + (Array.isArray(token.range) ? `[${token?.range?.[0]}, ${token?.range?.[1] ?? '\u221e'}]` : '') + '>' + renderAttributes(token);
968
951
  case ValidationTokenEnum.DeclarationType:
969
952
  return "<'" + token.val + "'>" + renderAttributes(token);
970
953
  case ValidationTokenEnum.Number:
@@ -1060,4 +1043,4 @@ function minify(ast) {
1060
1043
  return ast;
1061
1044
  }
1062
1045
 
1063
- export { WalkValidationTokenEnum, WalkValidationTokenKeyTypeEnum, parseSyntax, renderSyntax };
1046
+ export { parseSyntax, renderSyntax };