@eslint/css-tree 3.3.3 → 3.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/dist/data.js CHANGED
@@ -95,15 +95,15 @@ export default {
95
95
  "acos()": "acos( <calc-sum> )",
96
96
  "alpha-value": "<number>|<percentage>",
97
97
  "an+b": "odd|even|<integer>|<n-dimension>|'+'? † n|-n|<ndashdigit-dimension>|'+'? † <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? † n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? † n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? † n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>",
98
- "anchor()": "anchor( <anchor-element>?&&<anchor-side> , <length-percentage>? )",
98
+ "anchor()": "anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )",
99
99
  "anchor-name": "<dashed-ident>",
100
100
  "anchor-side": "inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center",
101
101
  "anchor-size": "width|height|block|inline|self-block|self-inline",
102
- "anchor-size()": "anchor-size( [<anchor-element>||<anchor-size>]? , <length-percentage>? )",
102
+ "anchor-size()": "anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )",
103
103
  "angle-percentage": "<angle>|<percentage>",
104
- "angular-color-hint": "<angle-percentage>",
105
- "angular-color-stop": "<color>&&<color-stop-angle>?",
106
- "angular-color-stop-list": "[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>",
104
+ "angular-color-hint": "<angle-percentage>|<zero>",
105
+ "angular-color-stop": "<color> <color-stop-angle>?",
106
+ "angular-color-stop-list": "<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?",
107
107
  "animateable-feature": "scroll-position|contents|<custom-ident>",
108
108
  "asin()": "asin( <calc-sum> )",
109
109
  "atan()": "atan( <calc-sum> )",
@@ -118,6 +118,7 @@ export default {
118
118
  "axis": "block|inline|x|y",
119
119
  "baseline-position": "[first|last]? baseline",
120
120
  "basic-shape": "<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>",
121
+ "basic-shape-rect": "<inset()>|<rect()>|<xywh()>",
121
122
  "bg-clip": "<visual-box>|border-area|text",
122
123
  "bg-image": "none|<image>",
123
124
  "bg-layer": "<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>",
@@ -146,9 +147,9 @@ export default {
146
147
  "color-interpolation-method": "in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]",
147
148
  "color-mix()": "color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )",
148
149
  "color-stop": "<color-stop-length>|<color-stop-angle>",
149
- "color-stop-angle": "<angle-percentage>{1,2}",
150
+ "color-stop-angle": "[<angle-percentage>|<zero>]{1,2}",
150
151
  "color-stop-length": "<length-percentage>{1,2}",
151
- "color-stop-list": "[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",
152
+ "color-stop-list": "<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?",
152
153
  "colorspace-params": "[<predefined-rgb-params>|<xyz-params>]",
153
154
  "combinator": "'>'|'+'|'~'|['|' '|']",
154
155
  "common-lig-values": "[common-ligatures|no-common-ligatures]",
@@ -159,7 +160,11 @@ export default {
159
160
  "compositing-operator": "add|subtract|intersect|exclude",
160
161
  "compound-selector": "[<type-selector>? <subclass-selector>*]!",
161
162
  "compound-selector-list": "<compound-selector>#",
162
- "conic-gradient()": "conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )",
163
+ "conic-gradient()": "conic-gradient( [<conic-gradient-syntax>] )",
164
+ "conic-gradient-syntax": "[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>",
165
+ "container-condition": "not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]",
166
+ "container-name": "<custom-ident>",
167
+ "container-query": "not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]",
163
168
  "content-distribution": "space-between|space-around|space-evenly|stretch",
164
169
  "content-list": "[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+",
165
170
  "content-position": "center|start|end|flex-start|flex-end",
@@ -175,7 +180,8 @@ export default {
175
180
  "counter-style-name": "<custom-ident>",
176
181
  "counters()": "counters( <counter-name> , <string> , <counter-style>? )",
177
182
  "cross-fade()": "cross-fade( <cf-mixing-image> , <cf-final-image>? )",
178
- "cubic-bezier-timing-function": "ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )",
183
+ "cubic-bezier()": "cubic-bezier( [<number [0,1]> , <number>]#{2} )",
184
+ "cubic-bezier-timing-function": "ease|ease-in|ease-out|ease-in-out|<cubic-bezier()>",
179
185
  "custom-color-space": "<dashed-ident>",
180
186
  "custom-params": "<dashed-ident> [<number>|<percentage>|none]+",
181
187
  "dasharray": "[[<length-percentage>|<number>]+]#",
@@ -189,12 +195,11 @@ export default {
189
195
  "display-listitem": "<display-outside>?&&[flow|flow-root]?&&list-item",
190
196
  "display-outside": "block|inline|run-in",
191
197
  "drop-shadow()": "drop-shadow( [<color>?&&<length>{2,3}] )",
192
- "easing-function": "linear|<cubic-bezier-timing-function>|<step-timing-function>",
198
+ "easing-function": "<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>",
193
199
  "east-asian-variant-values": "[jis78|jis83|jis90|jis04|simplified|traditional]",
194
200
  "east-asian-width-values": "[full-width|proportional-width]",
195
201
  "element()": "element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )",
196
202
  "ellipse()": "ellipse( <radial-size>? [at <position>]? )",
197
- "ending-shape": "circle|ellipse",
198
203
  "env()": "env( <custom-ident> , <declaration-value>? )",
199
204
  "exp()": "exp( <calc-sum> )",
200
205
  "explicit-track-list": "[<line-names>? <track-size>]+ <line-names>?",
@@ -216,10 +221,12 @@ export default {
216
221
  "font-stretch-absolute": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>",
217
222
  "font-variant-css21": "[normal|small-caps]",
218
223
  "font-weight-absolute": "normal|bold|<number [1,1000]>",
224
+ "form-control-identifier": "select",
219
225
  "frequency-percentage": "<frequency>|<percentage>",
226
+ "generic-complete": "serif|sans-serif|system-ui|cursive|fantasy|math|monospace",
220
227
  "general-enclosed": "[<function-token> <any-value>? )]|[( <any-value>? )]",
221
228
  "generic-family": "<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>",
222
- "generic-name": "serif|sans-serif|cursive|fantasy|monospace",
229
+ "generic-incomplete": "ui-serif|ui-sans-serif|ui-monospace|ui-rounded",
223
230
  "geometry-box": "<shape-box>|fill-box|stroke-box|view-box",
224
231
  "gradient": "<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>",
225
232
  "grayscale()": "grayscale( [<number>|<percentage>]? )",
@@ -242,8 +249,7 @@ export default {
242
249
  "inset()": "inset( <length-percentage>{1,4} [round <'border-radius'>]? )",
243
250
  "invert()": "invert( [<number>|<percentage>]? )",
244
251
  "keyframe-block": "<keyframe-selector># { <declaration-list> }",
245
- "keyframe-block-list": "<keyframe-block>+",
246
- "keyframe-selector": "from|to|<percentage>|<timeline-range-name> <percentage>",
252
+ "keyframe-selector": "from|to|<percentage [0,100]>|<timeline-range-name> <percentage>",
247
253
  "keyframes-name": "<custom-ident>|<string>",
248
254
  "lab()": "lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
249
255
  "layer()": "layer( <layer-name> )",
@@ -257,9 +263,12 @@ export default {
257
263
  "line-names": "'[' <custom-ident>* ']'",
258
264
  "line-style": "none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset",
259
265
  "line-width": "<length>|thin|medium|thick",
266
+ "linear()": "linear( [<number>&&<percentage>{0,2}]# )",
260
267
  "linear-color-hint": "<length-percentage>",
261
268
  "linear-color-stop": "<color> <color-stop-length>?",
262
- "linear-gradient()": "linear-gradient( [[<angle>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list> )",
269
+ "linear-easing-function": "linear|<linear()>",
270
+ "linear-gradient()": "linear-gradient( [<linear-gradient-syntax>] )",
271
+ "linear-gradient-syntax": "[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>",
263
272
  "log()": "log( <calc-sum> , <calc-sum>? )",
264
273
  "mask-layer": "<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>",
265
274
  "mask-position": "[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?",
@@ -288,12 +297,12 @@ export default {
288
297
  "minmax()": "minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )",
289
298
  "mod()": "mod( <calc-sum> , <calc-sum> )",
290
299
  "n-dimension": "<dimension-token>",
291
- "ndash-dimension": "<dimension-token>",
292
- "ndashdigit-dimension": "<dimension-token>",
293
- "ndashdigit-ident": "<ident-token>",
294
300
  "name-repeat": "repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )",
295
301
  "named-color": "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",
296
302
  "namespace-prefix": "<ident>",
303
+ "ndash-dimension": "<dimension-token>",
304
+ "ndashdigit-dimension": "<dimension-token>",
305
+ "ndashdigit-ident": "<ident-token>",
297
306
  "ns-prefix": "[<ident-token>|'*']? '|'",
298
307
  "number-percentage": "<number>|<percentage>",
299
308
  "numeric-figure-values": "[lining-nums|oldstyle-nums]",
@@ -330,23 +339,26 @@ export default {
330
339
  "pseudo-class-selector": "':' <ident-token>|':' <function-token> <any-value> ')'",
331
340
  "pseudo-element-selector": "':' <pseudo-class-selector>|<legacy-pseudo-element-selector>",
332
341
  "pseudo-page": ": [left|right|first|blank]",
342
+ "query-in-parens": "( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",
333
343
  "quote": "open-quote|close-quote|no-open-quote|no-close-quote",
334
344
  "radial-extent": "closest-corner|closest-side|farthest-corner|farthest-side",
335
- "radial-gradient()": "radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )",
345
+ "radial-gradient()": "radial-gradient( [<radial-gradient-syntax>] )",
346
+ "radial-gradient-syntax": "[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>",
347
+ "radial-shape": "circle|ellipse",
336
348
  "radial-size": "<radial-extent>|<length [0,∞]>|<length-percentage [0,∞]>{2}",
337
349
  "ratio": "<number [0,∞]> [/ <number [0,∞]>]?",
338
350
  "ray()": "ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )",
339
351
  "ray-size": "closest-side|closest-corner|farthest-side|farthest-corner|sides",
352
+ "rect()": "rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )",
340
353
  "rectangular-color-space": "srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65",
341
354
  "relative-selector": "<combinator>? <complex-selector>",
342
355
  "relative-selector-list": "<relative-selector>#",
343
356
  "relative-size": "larger|smaller",
344
- "rect()": "rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )",
345
357
  "rem()": "rem( <calc-sum> , <calc-sum> )",
346
358
  "repeat-style": "repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}",
347
- "repeating-conic-gradient()": "repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )",
348
- "repeating-linear-gradient()": "repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )",
349
- "repeating-radial-gradient()": "repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )",
359
+ "repeating-conic-gradient()": "repeating-conic-gradient( [<conic-gradient-syntax>] )",
360
+ "repeating-linear-gradient()": "repeating-linear-gradient( [<linear-gradient-syntax>] )",
361
+ "repeating-radial-gradient()": "repeating-radial-gradient( [<radial-gradient-syntax>] )",
350
362
  "reversed-counter-name": "reversed( <counter-name> )",
351
363
  "rgb()": "rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )",
352
364
  "rgba()": "rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )",
@@ -367,6 +379,9 @@ export default {
367
379
  "scope-start": "<forgiving-selector-list>",
368
380
  "scroll()": "scroll( [<scroller>||<axis>]? )",
369
381
  "scroller": "root|nearest|self",
382
+ "scroll-state-feature": "<media-query-list>",
383
+ "scroll-state-in-parens": "( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>",
384
+ "scroll-state-query": "not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>",
370
385
  "selector-list": "<complex-selector-list>",
371
386
  "self-position": "center|start|end|self-start|self-end|flex-start|flex-end",
372
387
  "sepia()": "sepia( [<number>|<percentage>]? )",
@@ -389,12 +404,17 @@ export default {
389
404
  "single-transition": "[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>",
390
405
  "single-transition-property": "all|<custom-ident>",
391
406
  "size": "closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}",
407
+ "size-feature": "<mf-plain>|<mf-boolean>|<mf-range>",
392
408
  "skew()": "skew( [<angle>|<zero>] , [<angle>|<zero>]? )",
393
409
  "skewX()": "skewX( [<angle>|<zero>] )",
394
410
  "skewY()": "skewY( [<angle>|<zero>] )",
395
411
  "sqrt()": "sqrt( <calc-sum> )",
396
412
  "step-position": "jump-start|jump-end|jump-none|jump-both|start|end",
397
- "step-timing-function": "step-start|step-end|steps( <integer> [, <step-position>]? )",
413
+ "step-easing-function": "step-start|step-end|<steps()>",
414
+ "steps()": "steps( <integer> , <step-position>? )",
415
+ "style-feature": "<declaration>",
416
+ "style-in-parens": "( <style-condition> )|( <style-feature> )|<general-enclosed>",
417
+ "style-query": "<style-condition>|<style-feature>",
398
418
  "subclass-selector": "<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>",
399
419
  "supports-condition": "not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*",
400
420
  "supports-decl": "( <declaration> )",
@@ -461,20 +481,14 @@ export default {
461
481
  "-ms-filter-function": "<-ms-filter-function-progid>|<-ms-filter-function-legacy>",
462
482
  "-ms-filter-function-progid": "'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]",
463
483
  "-ms-filter-function-legacy": "<ident-token>|<function-token> <any-value>? )",
464
- "absolute-color-base": "<hex-color>|<absolute-color-function>|<named-color>|transparent",
465
- "absolute-color-function": "<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>",
466
484
  "age": "child|young|old",
467
485
  "attr-name": "<wq-name>",
468
486
  "attr-fallback": "<any-value>",
469
487
  "bottom": "<length>|auto",
470
- "container-name": "<custom-ident>",
471
- "container-condition": "not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]",
472
488
  "cubic-bezier-easing-function": "ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )",
473
489
  "generic-voice": "[<age>? <gender> <integer>?]",
474
490
  "gender": "male|female|neutral",
475
491
  "generic-script-specific": "generic( kai )|generic( fangsong )|generic( nastaliq )",
476
- "generic-complete": "serif|sans-serif|system-ui|cursive|fantasy|math|monospace",
477
- "generic-incomplete": "ui-serif|ui-sans-serif|ui-monospace|ui-rounded",
478
492
  "-non-standard-generic-family": "-apple-system|BlinkMacSystemFont",
479
493
  "intrinsic-size-keyword": "min-content|max-content|fit-content",
480
494
  "left": "<length>|auto",
@@ -507,15 +521,9 @@ export default {
507
521
  "number-zero-one": "<number [0,1]>",
508
522
  "number-one-or-greater": "<number [1,∞]>",
509
523
  "xyz-space": "xyz|xyz-d50|xyz-d65",
510
- "query-in-parens": "( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",
511
- "size-feature": "<mf-plain>|<mf-boolean>|<mf-range>",
512
- "style-feature": "<declaration>",
513
- "style-query": "<style-condition>|<style-feature>",
514
524
  "style-condition": "not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]",
515
- "style-in-parens": "( <style-condition> )|( <style-feature> )|<general-enclosed>",
516
525
  "-non-standard-display": "-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",
517
526
  "inset-area": "[[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}]",
518
- "anchor-element": "<dashed-ident>",
519
527
  "font-variant-css2": "normal|small-caps",
520
528
  "font-width-css3": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",
521
529
  "system-family-name": "caption|icon|menu|message-box|small-caption|status-bar"
@@ -627,6 +635,7 @@ export default {
627
635
  "align-items": "normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]",
628
636
  "align-self": "auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>",
629
637
  "align-tracks": "[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",
638
+ "alignment-baseline": "auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",
630
639
  "all": "initial|inherit|unset|revert|revert-layer",
631
640
  "anchor-name": "none|<dashed-ident>#",
632
641
  "anchor-scope": "none|all|<dashed-ident>#",
@@ -660,6 +669,7 @@ export default {
660
669
  "background-position-y": "[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#",
661
670
  "background-repeat": "<repeat-style>#",
662
671
  "background-size": "<bg-size>#",
672
+ "baseline-shift": "baseline|sub|super|<svg-length>",
663
673
  "block-size": "<'width'>",
664
674
  "border": "<line-width>||<line-style>||<color>",
665
675
  "border-block": "<'border-block-start'>",
@@ -802,7 +812,7 @@ export default {
802
812
  "font-language-override": "normal|<string>",
803
813
  "font-optical-sizing": "auto|none",
804
814
  "font-palette": "normal|light|dark|<palette-identifier>|<palette-mix()>",
805
- "font-size": "<absolute-size>|<relative-size>|<length-percentage>",
815
+ "font-size": "<absolute-size>|<relative-size>|<length-percentage [0,∞]>|math",
806
816
  "font-size-adjust": "none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]",
807
817
  "font-smooth": "auto|never|always|<absolute-size>|<length>",
808
818
  "font-stretch": "<font-stretch-absolute>",
@@ -927,6 +937,7 @@ export default {
927
937
  "mix-blend-mode": "<blend-mode>|plus-lighter",
928
938
  "object-fit": "fill|contain|cover|none|scale-down",
929
939
  "object-position": "<position>",
940
+ "object-view-box": "none|<basic-shape-rect>",
930
941
  "offset": "[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?",
931
942
  "offset-anchor": "auto|<position>",
932
943
  "offset-distance": "<length-percentage>",
@@ -999,6 +1010,7 @@ export default {
999
1010
  "ry": "<length>|<percentage>",
1000
1011
  "scale": "none|[<number>|<percentage>]{1,3}",
1001
1012
  "scroll-behavior": "auto|smooth",
1013
+ "scroll-initial-target": "none|nearest",
1002
1014
  "scroll-margin": "<length>{1,4}",
1003
1015
  "scroll-margin-block": "<length>{1,2}",
1004
1016
  "scroll-margin-block-end": "<length>",
@@ -1103,10 +1115,10 @@ export default {
1103
1115
  "user-select": "auto|text|none|all",
1104
1116
  "vector-effect": "none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position",
1105
1117
  "vertical-align": "baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",
1106
- "view-timeline": "[<'view-timeline-name'> <'view-timeline-axis'>?]#",
1118
+ "view-timeline": "[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#",
1107
1119
  "view-timeline-axis": "[block|inline|x|y]#",
1108
1120
  "view-timeline-inset": "[[auto|<length-percentage>]{1,2}]#",
1109
- "view-timeline-name": "none|<dashed-ident>#",
1121
+ "view-timeline-name": "[none|<dashed-ident>]#",
1110
1122
  "view-transition-class": "none|<custom-ident>+",
1111
1123
  "view-transition-name": "none|<custom-ident>",
1112
1124
  "visibility": "visible|hidden|collapse",
@@ -1123,6 +1135,7 @@ export default {
1123
1135
  "y": "<length>|<percentage>",
1124
1136
  "z-index": "auto|<integer>",
1125
1137
  "zoom": "normal|reset|<number [0,∞]>||<percentage [0,∞]>",
1138
+ "-moz-background-clip": "padding|border",
1126
1139
  "-moz-border-radius-bottomleft": "<'border-bottom-left-radius'>",
1127
1140
  "-moz-border-radius-bottomright": "<'border-bottom-right-radius'>",
1128
1141
  "-moz-border-radius-topleft": "<'border-top-left-radius'>",
@@ -1142,6 +1155,7 @@ export default {
1142
1155
  "-ms-grid-column-align": "start|end|center|stretch",
1143
1156
  "-ms-grid-row-align": "start|end|center|stretch",
1144
1157
  "-ms-hyphenate-limit-last": "none|always|column|page|spread",
1158
+ "-webkit-background-clip": "[<visual-box>|border|padding|content|text]#",
1145
1159
  "-webkit-column-break-after": "always|auto|avoid",
1146
1160
  "-webkit-column-break-before": "always|auto|avoid",
1147
1161
  "-webkit-column-break-inside": "always|auto|avoid",
@@ -1150,8 +1164,6 @@ export default {
1150
1164
  "-webkit-print-color-adjust": "economy|exact",
1151
1165
  "-webkit-text-security": "none|circle|disc|square",
1152
1166
  "-webkit-user-drag": "none|element|auto",
1153
- "alignment-baseline": "auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",
1154
- "baseline-shift": "baseline|sub|super|<svg-length>",
1155
1167
  "behavior": "<url>+",
1156
1168
  "cue": "<'cue-before'> <'cue-after'>?",
1157
1169
  "cue-after": "<url> <decibel>?|none",
@@ -1197,6 +1209,10 @@ export default {
1197
1209
  "system": "cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"
1198
1210
  }
1199
1211
  },
1212
+ "container": {
1213
+ "prelude": "[<container-name>]? <container-condition>",
1214
+ "descriptors": null
1215
+ },
1200
1216
  "document": {
1201
1217
  "prelude": "[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",
1202
1218
  "descriptors": null
@@ -1328,10 +1344,6 @@ export default {
1328
1344
  "types": "none|<custom-ident>+"
1329
1345
  }
1330
1346
  },
1331
- "container": {
1332
- "prelude": "[<container-name>]? <container-condition>",
1333
- "descriptors": null
1334
- },
1335
1347
  "nest": {
1336
1348
  "prelude": "<complex-selector-list>",
1337
1349
  "descriptors": null
package/dist/version.cjs CHANGED
@@ -1 +1 @@
1
- module.exports = "3.3.3";
1
+ module.exports = "3.4.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "3.3.3";
1
+ export const version = "3.4.0";
@@ -1,4 +1,5 @@
1
- import { tokenize, Delim, WhiteSpace } from '../tokenizer/index.js';
1
+ import { Delim, WhiteSpace } from '../tokenizer/index.js';
2
+ import { getTokenizer } from '../utils/get-tokenizer.js';
2
3
  import { generateSourceMap } from './sourceMap.js';
3
4
  import * as tokenBefore from './token-before.js';
4
5
 
@@ -23,12 +24,6 @@ function processChildren(node, delimeter) {
23
24
  node.children.forEach(this.node, this);
24
25
  }
25
26
 
26
- function processChunk(chunk) {
27
- tokenize(chunk, (type, start, end) => {
28
- this.token(type, chunk.slice(start, end));
29
- });
30
- }
31
-
32
27
  export function createGenerator(config) {
33
28
  const types = new Map();
34
29
 
@@ -87,7 +82,13 @@ export function createGenerator(config) {
87
82
  node: (node) => handlers.node(node),
88
83
  children: processChildren,
89
84
  token: (type, value) => handlers.token(type, value),
90
- tokenize: processChunk
85
+ tokenize: function (chunk) {
86
+ const tokenize = getTokenizer(config);
87
+
88
+ return tokenize(chunk, (type, start, end) => {
89
+ this.token(type, chunk.slice(start, end));
90
+ });
91
+ }
91
92
  };
92
93
 
93
94
  handlers.node(node);
package/lib/index.d.ts CHANGED
@@ -2693,19 +2693,21 @@ type ParserContext = TokenStream
2693
2693
  [key: string]: unknown;
2694
2694
  };
2695
2695
 
2696
- interface StructureDescriptor {
2697
- type: string;
2698
- optional?: boolean;
2699
- parse?: (this: ParserContext) => CssNodeCommon;
2700
- generate?: (this: ParserContext, node: CssNodeCommon) => void;
2696
+ type StructureValue = string | Function | null;
2697
+ type StructureDescriptor = StructureValue | Array<StructureValue> | Array<Array<StructureValue>>;
2698
+
2699
+ interface StructureDefinition {
2700
+ children?: Array<string>;
2701
+
2702
+ [key: string]: StructureDescriptor | undefined;
2701
2703
  }
2702
2704
 
2703
2705
  interface NodeSyntaxConfig<T extends CssNodeCommon = CssNodeCommon> {
2704
2706
  name: string;
2705
- structure: Record<string, StructureDescriptor>;
2707
+ structure: StructureDefinition;
2706
2708
  parse(this: ParserContext): T;
2707
2709
  generate(this: ParserContext, node: T): void;
2708
- walkContext: WalkContext;
2710
+ walkContext?: string;
2709
2711
  }
2710
2712
 
2711
2713
  interface AtruleSyntax {
@@ -2736,6 +2738,7 @@ export interface SyntaxConfig<T extends CssNodeCommon = CssNodeCommon> {
2736
2738
  scope: Record<string, Recognizer>;
2737
2739
  features: Record<string, Recognizer>;
2738
2740
  parseContext: ParseContext;
2741
+ tokenize: TokenizeFunction;
2739
2742
  }
2740
2743
 
2741
2744
  interface LexerStructureWarning {
@@ -1,4 +1,4 @@
1
- import { tokenize } from '../tokenizer/index.js';
1
+ import { getTokenizer } from '../utils/get-tokenizer.js';
2
2
 
3
3
  const astToTokens = {
4
4
  decorator(handlers) {
@@ -27,8 +27,9 @@ const astToTokens = {
27
27
  }
28
28
  };
29
29
 
30
- function stringToTokens(str) {
30
+ function stringToTokens(str, syntax) {
31
31
  const tokens = [];
32
+ const tokenize = getTokenizer(syntax);
32
33
 
33
34
  tokenize(str, (type, start, end) =>
34
35
  tokens.push({
@@ -43,7 +44,7 @@ function stringToTokens(str) {
43
44
 
44
45
  export default function(value, syntax) {
45
46
  if (typeof value === 'string') {
46
- return stringToTokens(value);
47
+ return stringToTokens(value, syntax);
47
48
  }
48
49
 
49
50
  return syntax.generate(value, astToTokens);
@@ -1,7 +1,6 @@
1
1
  import { List } from '../utils/List.js';
2
2
  import { SyntaxError } from './SyntaxError.js';
3
3
  import {
4
- tokenize,
5
4
  OffsetToLocation,
6
5
  TokenStream,
7
6
  tokenNames,
@@ -21,6 +20,7 @@ import {
21
20
  Number as NumberToken
22
21
  } from '../tokenizer/index.js';
23
22
  import { readSequence } from './sequence.js';
23
+ import { getTokenizer } from '../utils/get-tokenizer.js';
24
24
 
25
25
  const NOOP = () => {};
26
26
  const EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)
@@ -57,7 +57,8 @@ function processConfig(config) {
57
57
  scope: Object.assign(Object.create(null), config.scope),
58
58
  atrule: fetchParseValues(config.atrule),
59
59
  pseudo: fetchParseValues(config.pseudo),
60
- node: fetchParseValues(config.node)
60
+ node: fetchParseValues(config.node),
61
+ tokenize: getTokenizer(config)
61
62
  };
62
63
 
63
64
  for (const [name, context] of Object.entries(config.parseContext)) {
@@ -327,7 +328,7 @@ export function createParser(config) {
327
328
  source = source_;
328
329
  options = options || {};
329
330
 
330
- parser.setSource(source, tokenize);
331
+ parser.setSource(source, parser.tokenize);
331
332
  locationMap.setSource(
332
333
  source,
333
334
  options.offset,
@@ -115,6 +115,12 @@ export default function mix(dest, src) {
115
115
  case 'node':
116
116
  result[prop] = mergeDicts(dest[prop], value, ['name', 'structure', 'parse', 'generate', 'walkContext']);
117
117
  break;
118
+
119
+ case 'tokenize':
120
+ if (typeof value === 'function') {
121
+ result[prop] = value;
122
+ }
123
+ break;
118
124
  }
119
125
  }
120
126
 
@@ -2,6 +2,7 @@ import * as scope from '../scope/index.js';
2
2
  import atrule from '../atrule/index.js';
3
3
  import pseudo from '../pseudo/index.js';
4
4
  import * as node from '../node/index-parse.js';
5
+ import { tokenize } from '../../tokenizer/index.js';
5
6
 
6
7
  export default {
7
8
  parseContext: {
@@ -41,5 +42,6 @@ export default {
41
42
  scope,
42
43
  atrule,
43
44
  pseudo,
44
- node
45
+ node,
46
+ tokenize
45
47
  };
@@ -1,10 +1,10 @@
1
- import { tokenize } from '../tokenizer/index.js';
2
1
  import { createParser } from '../parser/create.js';
3
2
  import { createGenerator } from '../generator/create.js';
4
3
  import { createConvertor } from '../convertor/create.js';
5
4
  import { createWalker } from '../walker/create.js';
6
5
  import { Lexer } from '../lexer/Lexer.js';
7
6
  import mix from './config/mix.js';
7
+ import { getTokenizer } from '../utils/get-tokenizer.js';
8
8
 
9
9
  function createSyntax(config) {
10
10
  const parse = createParser(config);
@@ -16,7 +16,7 @@ function createSyntax(config) {
16
16
  lexer: null,
17
17
  createLexer: config => new Lexer(config, syntax, syntax.lexer.structure),
18
18
 
19
- tokenize,
19
+ tokenize: getTokenizer(config),
20
20
  parse,
21
21
  generate,
22
22
 
@@ -1,7 +1,7 @@
1
1
  import { CDC } from '../../tokenizer/index.js';
2
2
 
3
3
  export const name = 'CDC';
4
- export const structure = [];
4
+ export const structure = {};
5
5
 
6
6
  export function parse() {
7
7
  const start = this.tokenStart;
@@ -1,7 +1,7 @@
1
1
  import { CDO } from '../../tokenizer/index.js';
2
2
 
3
3
  export const name = 'CDO';
4
- export const structure = [];
4
+ export const structure = {};
5
5
 
6
6
  export function parse() {
7
7
  const start = this.tokenStart;
@@ -0,0 +1,18 @@
1
+ import { tokenize } from '../tokenizer/index.js';
2
+
3
+ const FUNCTION_TYPE = 'function';
4
+
5
+ /**
6
+ * Gets the tokenizer function from the configuration object or returns the default tokenizer
7
+ *
8
+ * @param config Configuration object
9
+ * @returns Corresponding tokenizer function
10
+ */
11
+ export function getTokenizer(config) {
12
+ if (config && typeof config.tokenize === FUNCTION_TYPE) {
13
+ return config.tokenize;
14
+ }
15
+
16
+ // Fallback to the default tokenizer
17
+ return tokenize;
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint/css-tree",
3
- "version": "3.3.3",
3
+ "version": "3.4.0",
4
4
  "description": "A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations",
5
5
  "author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",
6
6
  "license": "MIT",
@@ -106,7 +106,7 @@
106
106
  "test:types": "tsc -p tests/types/tsconfig.json"
107
107
  },
108
108
  "dependencies": {
109
- "mdn-data": "^2.18.0",
109
+ "mdn-data": "2.20.0",
110
110
  "source-map-js": "^1.0.1"
111
111
  },
112
112
  "devDependencies": {