@eslint/css-tree 3.6.3 → 3.6.6
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/cjs/lexer/match.cjs +1 -1
- package/cjs/syntax/atrule/media.cjs +2 -2
- package/cjs/syntax/node/Atrule.cjs +3 -3
- package/cjs/syntax/node/Block.cjs +1 -1
- package/data/patch.json +102 -14
- package/dist/csstree.esm.js +10 -10
- package/dist/csstree.js +10 -10
- package/dist/data.cjs +48 -23
- package/dist/data.js +48 -23
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/lib/lexer/match.js +1 -1
- package/lib/syntax/atrule/media.js +2 -2
- package/lib/syntax/node/Atrule.js +3 -3
- package/lib/syntax/node/Block.js +1 -1
- package/package.json +2 -2
package/cjs/lexer/match.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const EXIT_REASON_MATCH = 'Match';
|
|
|
13
13
|
const EXIT_REASON_MISMATCH = 'Mismatch';
|
|
14
14
|
const EXIT_REASON_ITERATION_LIMIT = 'Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)';
|
|
15
15
|
|
|
16
|
-
const ITERATION_LIMIT =
|
|
16
|
+
const ITERATION_LIMIT = 150000;
|
|
17
17
|
|
|
18
18
|
function reverseList(list) {
|
|
19
19
|
let prev = null;
|
|
@@ -30,7 +30,7 @@ const structure = {
|
|
|
30
30
|
block: ['Block', null]
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
function parse(isDeclaration = false) {
|
|
33
|
+
function parse(isDeclaration = false, { allowNestedRules = false } = {}) {
|
|
34
34
|
const start = this.tokenStart;
|
|
35
35
|
let name;
|
|
36
36
|
let nameLowerCase;
|
|
@@ -64,10 +64,10 @@ function parse(isDeclaration = false) {
|
|
|
64
64
|
case types.LeftCurlyBracket:
|
|
65
65
|
if (hasOwnProperty.call(this.atrule, nameLowerCase) &&
|
|
66
66
|
typeof this.atrule[nameLowerCase].block === 'function') {
|
|
67
|
-
block = this.atrule[nameLowerCase].block.call(this, isDeclaration);
|
|
67
|
+
block = this.atrule[nameLowerCase].block.call(this, isDeclaration, { allowNestedRules });
|
|
68
68
|
} else {
|
|
69
69
|
// TODO: should consume block content as Raw?
|
|
70
|
-
block = this.Block(isDeclarationBlockAtrule.call(this));
|
|
70
|
+
block = this.Block(isDeclaration || isDeclarationBlockAtrule.call(this), { allowNestedRules });
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
break;
|
|
@@ -89,7 +89,7 @@ function parse(isStyleBlock, { allowNestedRules = false } = {}) {
|
|
|
89
89
|
break;
|
|
90
90
|
|
|
91
91
|
case types.AtKeyword:
|
|
92
|
-
children.push(this.parseWithFallback(this.Atrule.bind(this, isStyleBlock), consumeRaw));
|
|
92
|
+
children.push(this.parseWithFallback(this.Atrule.bind(this, isStyleBlock, { allowNestedRules }), consumeRaw));
|
|
93
93
|
break;
|
|
94
94
|
|
|
95
95
|
default:
|
package/data/patch.json
CHANGED
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"font-features-values": {
|
|
18
|
+
"comment": "The features values syntax is defined in https://www.w3.org/TR/css-fonts-4/#at-ruledef-font-feature-values",
|
|
19
|
+
"prelude": "[<string> | <custom-ident>]+",
|
|
20
|
+
"descriptors": {
|
|
21
|
+
"font-display": "auto | block | swap | fallback | optional"
|
|
22
|
+
}
|
|
19
23
|
},
|
|
20
24
|
"scope": {
|
|
21
25
|
"prelude": "[ ( <scope-start> ) ]? [ to ( <scope-end> ) ]?"
|
|
@@ -766,6 +770,102 @@
|
|
|
766
770
|
"color()": {
|
|
767
771
|
"syntax": "color( <colorspace-params> [ / [ <alpha-value> | none ] ]? )"
|
|
768
772
|
},
|
|
773
|
+
"rgb-component": {
|
|
774
|
+
"syntax": "r | g | b | alpha"
|
|
775
|
+
},
|
|
776
|
+
"legacy-rgb-syntax": {
|
|
777
|
+
"syntax": "rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? ) | rgb( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )"
|
|
778
|
+
},
|
|
779
|
+
"modern-rgb-syntax": {
|
|
780
|
+
"syntax": "rgb( from <color> [ <number> | <percentage> | <rgb-component> ]{3} [ / [ <alpha-value> | <rgb-component> ] ]? )"
|
|
781
|
+
},
|
|
782
|
+
"rgb()": {
|
|
783
|
+
"syntax": "<legacy-rgb-syntax> | <modern-rgb-syntax>"
|
|
784
|
+
},
|
|
785
|
+
"legacy-rgba-syntax": {
|
|
786
|
+
"syntax": "rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? ) | rgba( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )"
|
|
787
|
+
},
|
|
788
|
+
"modern-rgba-syntax": {
|
|
789
|
+
"syntax": "rgba( from <color> [ <number> | <percentage> | <rgb-component> ]{3} [ / [ <alpha-value> | <rgb-component> ] ]? )"
|
|
790
|
+
},
|
|
791
|
+
"rgba()": {
|
|
792
|
+
"syntax": "<legacy-rgba-syntax> | <modern-rgba-syntax>"
|
|
793
|
+
},
|
|
794
|
+
"hsl-component": {
|
|
795
|
+
"syntax": "h | s | l | alpha"
|
|
796
|
+
},
|
|
797
|
+
"legacy-hsl-syntax": {
|
|
798
|
+
"syntax": "hsl( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsl( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
|
|
799
|
+
},
|
|
800
|
+
"modern-hsl-syntax": {
|
|
801
|
+
"syntax": "hsl( from <color> [ <hue> | <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ / [ <alpha-value> | <hsl-component> | none ] ]? )"
|
|
802
|
+
},
|
|
803
|
+
"hsl()": {
|
|
804
|
+
"syntax": "<legacy-hsl-syntax> | <modern-hsl-syntax>"
|
|
805
|
+
},
|
|
806
|
+
"legacy-hsla-syntax": {
|
|
807
|
+
"syntax": "hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsla( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
|
|
808
|
+
},
|
|
809
|
+
"modern-hsla-syntax": {
|
|
810
|
+
"syntax": "hsla( from <color> [ <hue> | <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ / [ <alpha-value> | <hsl-component> | none ] ]? )"
|
|
811
|
+
},
|
|
812
|
+
"hsla()": {
|
|
813
|
+
"syntax": "<legacy-hsla-syntax> | <modern-hsla-syntax>"
|
|
814
|
+
},
|
|
815
|
+
"hwb-component": {
|
|
816
|
+
"syntax": "h | w | b"
|
|
817
|
+
},
|
|
818
|
+
"legacy-hwb-syntax": {
|
|
819
|
+
"syntax": "hwb( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
|
|
820
|
+
},
|
|
821
|
+
"modern-hwb-syntax": {
|
|
822
|
+
"syntax": "hwb( from <color> [ <hue> | <percentage> | <number> | <hwb-component> | none ] [ <percentage> | <number> | <hwb-component> | none ] [ <percentage> | <number> | <hwb-component> | none ] [ / [ <alpha-value> | <hwb-component> | none ] ]? )"
|
|
823
|
+
},
|
|
824
|
+
"hwb()": {
|
|
825
|
+
"syntax": "<legacy-hwb-syntax> | <modern-hwb-syntax>"
|
|
826
|
+
},
|
|
827
|
+
"lab-component": {
|
|
828
|
+
"syntax": "l | a | b | alpha"
|
|
829
|
+
},
|
|
830
|
+
"legacy-lab-syntax": {
|
|
831
|
+
"syntax": "lab( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )"
|
|
832
|
+
},
|
|
833
|
+
"modern-lab-syntax": {
|
|
834
|
+
"syntax": "lab( from <color> [ <number> | <percentage> | <lab-component> ]{3} [ / [ <alpha-value> | <lab-component> ] ]? )"
|
|
835
|
+
},
|
|
836
|
+
"lab()": {
|
|
837
|
+
"syntax": "<legacy-lab-syntax> | <modern-lab-syntax>"
|
|
838
|
+
},
|
|
839
|
+
"legacy-oklab-syntax": {
|
|
840
|
+
"syntax": "oklab( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )"
|
|
841
|
+
},
|
|
842
|
+
"modern-oklab-syntax": {
|
|
843
|
+
"syntax": "oklab( from <color> [ <number> | <percentage> | <lab-component> ]{3} [ / [ <alpha-value> | <lab-component> ] ]? )"
|
|
844
|
+
},
|
|
845
|
+
"oklab()": {
|
|
846
|
+
"syntax": "<legacy-oklab-syntax> | <modern-oklab-syntax>"
|
|
847
|
+
},
|
|
848
|
+
"lch-component": {
|
|
849
|
+
"syntax": "l | c | h | alpha"
|
|
850
|
+
},
|
|
851
|
+
"legacy-lch-syntax": {
|
|
852
|
+
"syntax": "lch( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )"
|
|
853
|
+
},
|
|
854
|
+
"modern-lch-syntax": {
|
|
855
|
+
"syntax": "lch( from <color> [ <number> | <percentage> | <lch-component> ]{3} [ / [ <alpha-value> | <lch-component> ] ]? )"
|
|
856
|
+
},
|
|
857
|
+
"lch()": {
|
|
858
|
+
"syntax": "<legacy-lch-syntax> | <modern-lch-syntax>"
|
|
859
|
+
},
|
|
860
|
+
"legacy-oklch-syntax": {
|
|
861
|
+
"syntax": "oklch( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )"
|
|
862
|
+
},
|
|
863
|
+
"modern-oklch-syntax": {
|
|
864
|
+
"syntax": "oklch( from <color> [ <number> | <percentage> | <lch-component> ]{3} [ / [ <alpha-value> | <lch-component> ] ]? )"
|
|
865
|
+
},
|
|
866
|
+
"oklch()": {
|
|
867
|
+
"syntax": "<legacy-oklch-syntax> | <modern-oklch-syntax>"
|
|
868
|
+
},
|
|
769
869
|
"colorspace-params": {
|
|
770
870
|
"syntax": "[ <predefined-rgb-params> | <xyz-params>]"
|
|
771
871
|
},
|
|
@@ -811,18 +911,6 @@
|
|
|
811
911
|
"references": [
|
|
812
912
|
"https://drafts.csswg.org/css-anchor-position-1/#typedef-position-area"
|
|
813
913
|
]
|
|
814
|
-
},
|
|
815
|
-
"font-variant-css2": {
|
|
816
|
-
"syntax": "normal | small-caps",
|
|
817
|
-
"comment": "new definition on font-4, https://drafts.csswg.org/css-fonts-4/#font-variant-css21-values"
|
|
818
|
-
},
|
|
819
|
-
"font-width-css3": {
|
|
820
|
-
"syntax": "normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded",
|
|
821
|
-
"comment": "new definition on font-4, https://drafts.csswg.org/css-fonts-4/#font-width-css3-values"
|
|
822
|
-
},
|
|
823
|
-
"system-family-name": {
|
|
824
|
-
"syntax": "caption | icon | menu | message-box | small-caption | status-bar",
|
|
825
|
-
"comment": "new definition on font-4, https://drafts.csswg.org/css-fonts-4/#system-family-name-value"
|
|
826
914
|
}
|
|
827
915
|
}
|
|
828
916
|
}
|