@eslint/css-tree 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -200,11 +200,10 @@ When merging in changes from `csstree/csstree`, sync `upstream` in the GitHub UI
200
200
  The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
201
201
  to get your logo on our READMEs and [website](https://eslint.org/sponsors).
202
202
 
203
- <h3>Platinum Sponsors</h3>
204
- <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
203
+ <h3>Gold Sponsors</h3>
205
204
  <p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
206
205
  <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
207
- <p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel-ai.com"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a> <a href="https://www.testmuai.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
206
+ <p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel-ai.com"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a> <a href="https://www.testmuai.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
208
207
  <h3>Technology Sponsors</h3>
209
208
  Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
210
209
  <p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
@@ -37,8 +37,9 @@ const parseFunctions = {
37
37
  const children = this.createList();
38
38
  const node = parseWithFallback.call(
39
39
  this,
40
- this.Declaration,
41
- () => parseWithFallback.call(this, () => this.Condition('supports'))
40
+ this.tokenType === types.Ident && this.lookupTypeNonSC(1) === types.Colon
41
+ ? this.Declaration
42
+ : () => this.Condition('supports')
42
43
  );
43
44
 
44
45
  if (node.type !== 'Raw' || node.value !== '') {
@@ -5,6 +5,24 @@ const index$1 = require('../atrule/index.cjs');
5
5
  const index$2 = require('../pseudo/index.cjs');
6
6
  const indexParse = require('../node/index-parse.cjs');
7
7
  const index$3 = require('../../tokenizer/index.cjs');
8
+ const types = require('../../tokenizer/types.cjs');
9
+
10
+ function identifier() {
11
+ return this.Identifier();
12
+ }
13
+
14
+ function fontFormat() {
15
+ switch (this.tokenType) {
16
+ case types.Ident:
17
+ return this.Identifier();
18
+
19
+ case types.String:
20
+ return this.String();
21
+
22
+ default:
23
+ this.error('Identifier or string is expected');
24
+ }
25
+ }
8
26
 
9
27
  const config = {
10
28
  parseContext: {
@@ -33,7 +51,14 @@ const config = {
33
51
  supports: {
34
52
  selector() {
35
53
  return this.Selector();
36
- }
54
+ },
55
+ 'font-tech': identifier,
56
+ 'font-format': fontFormat,
57
+ 'at-rule'() {
58
+ return this.AtKeyword();
59
+ },
60
+ 'named-feature': identifier,
61
+ env: identifier
37
62
  },
38
63
  container: {
39
64
  style() {
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ const types = require('../../tokenizer/types.cjs');
4
+
5
+ const name = 'AtKeyword';
6
+ const structure = {
7
+ name: String
8
+ };
9
+
10
+ function parse() {
11
+ const start = this.tokenStart;
12
+
13
+ this.eat(types.AtKeyword);
14
+
15
+ return {
16
+ type: 'AtKeyword',
17
+ loc: this.getLocation(start, this.tokenStart),
18
+ name: this.substrToCursor(start + 1)
19
+ };
20
+ }
21
+
22
+ function generate(node) {
23
+ this.token(types.AtKeyword, '@' + node.name);
24
+ }
25
+
26
+ exports.generate = generate;
27
+ exports.name = name;
28
+ exports.parse = parse;
29
+ exports.structure = structure;
@@ -29,7 +29,12 @@ const parentheses = {
29
29
  media: featureOrRange,
30
30
  container: featureOrRange,
31
31
  supports() {
32
- return this.SupportsDeclaration();
32
+ if (this.lookupTypeNonSC(1) === types.Ident &&
33
+ this.lookupTypeNonSC(2) === types.Colon) {
34
+ return this.SupportsDeclaration();
35
+ }
36
+
37
+ return null;
33
38
  }
34
39
  };
35
40
 
@@ -6,7 +6,7 @@ const name = 'FeatureFunction';
6
6
  const structure = {
7
7
  kind: String,
8
8
  feature: String,
9
- value: ['Declaration', 'Selector']
9
+ value: ['Declaration', 'Selector', 'Identifier', 'String', 'AtKeyword', 'Raw']
10
10
  };
11
11
 
12
12
  function getFeatureParser(kind, name) {
@@ -32,6 +32,8 @@ function parse(kind = 'unknown') {
32
32
  const startValueToken = this.tokenIndex;
33
33
  const value = valueParser.call(this);
34
34
 
35
+ this.skipSC();
36
+
35
37
  if (this.eof === false &&
36
38
  this.isBalanceEdge(startValueToken) === false) {
37
39
  this.error();
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const AnPlusB = require('./AnPlusB.cjs');
4
+ const AtKeyword = require('./AtKeyword.cjs');
4
5
  const Atrule = require('./Atrule.cjs');
5
6
  const AtrulePrelude = require('./AtrulePrelude.cjs');
6
7
  const AttributeSelector = require('./AttributeSelector.cjs');
@@ -53,6 +54,7 @@ const WhiteSpace = require('./WhiteSpace.cjs');
53
54
 
54
55
 
55
56
  exports.AnPlusB = AnPlusB.generate;
57
+ exports.AtKeyword = AtKeyword.generate;
56
58
  exports.Atrule = Atrule.generate;
57
59
  exports.AtrulePrelude = AtrulePrelude.generate;
58
60
  exports.AttributeSelector = AttributeSelector.generate;
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const AnPlusB = require('./AnPlusB.cjs');
4
+ const AtKeyword = require('./AtKeyword.cjs');
4
5
  const Atrule = require('./Atrule.cjs');
5
6
  const AtrulePrelude = require('./AtrulePrelude.cjs');
6
7
  const AttributeSelector = require('./AttributeSelector.cjs');
@@ -53,6 +54,7 @@ const WhiteSpace = require('./WhiteSpace.cjs');
53
54
 
54
55
 
55
56
  exports.AnPlusB = AnPlusB.parse;
57
+ exports.AtKeyword = AtKeyword.parse;
56
58
  exports.Atrule = Atrule.parse;
57
59
  exports.AtrulePrelude = AtrulePrelude.parse;
58
60
  exports.AttributeSelector = AttributeSelector.parse;
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const AnPlusB = require('./AnPlusB.cjs');
4
+ const AtKeyword = require('./AtKeyword.cjs');
4
5
  const Atrule = require('./Atrule.cjs');
5
6
  const AtrulePrelude = require('./AtrulePrelude.cjs');
6
7
  const AttributeSelector = require('./AttributeSelector.cjs');
@@ -53,6 +54,7 @@ const WhiteSpace = require('./WhiteSpace.cjs');
53
54
 
54
55
 
55
56
  exports.AnPlusB = AnPlusB;
57
+ exports.AtKeyword = AtKeyword;
56
58
  exports.Atrule = Atrule;
57
59
  exports.AtrulePrelude = AtrulePrelude;
58
60
  exports.AttributeSelector = AttributeSelector;
package/data/patch.json CHANGED
@@ -634,6 +634,18 @@
634
634
  "comment": "new definition on font-4, https://drafts.csswg.org/css-fonts-4/#typedef-generic-family",
635
635
  "syntax": "<generic-script-specific>| <generic-complete> | <generic-incomplete> | <-non-standard-generic-family>"
636
636
  },
637
+ "font-features-tech": {
638
+ "syntax": "features-opentype | features-aat | features-graphite"
639
+ },
640
+ "font-format": {
641
+ "syntax": "<string> | collection | embedded-opentype | opentype | svg | truetype | woff | woff2"
642
+ },
643
+ "font-tech": {
644
+ "syntax": "<font-features-tech> | <color-font-tech> | variations | palettes | incremental"
645
+ },
646
+ "color-font-tech": {
647
+ "syntax": "color-COLRv0 | color-COLRv1 | color-SVG | color-sbix | color-CBDT"
648
+ },
637
649
  "generic-script-specific": {
638
650
  "syntax": "generic(kai) | generic(fangsong) | generic(nastaliq)"
639
651
  },
@@ -927,6 +939,24 @@
927
939
  "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule",
928
940
  "syntax": "( <style-condition> ) | ( <style-feature> ) | <general-enclosed>"
929
941
  },
942
+ "supports-feature": {
943
+ "syntax": "<supports-selector-fn> | <supports-font-tech-fn> | <supports-font-format-fn> | <supports-at-rule-fn> | <supports-named-feature-fn> | <supports-env-fn> | <supports-decl>"
944
+ },
945
+ "supports-font-tech-fn": {
946
+ "syntax": "font-tech( <font-tech> )"
947
+ },
948
+ "supports-font-format-fn": {
949
+ "syntax": "font-format( <font-format> )"
950
+ },
951
+ "supports-at-rule-fn": {
952
+ "syntax": "at-rule( <at-keyword-token> )"
953
+ },
954
+ "supports-named-feature-fn": {
955
+ "syntax": "named-feature( <ident> )"
956
+ },
957
+ "supports-env-fn": {
958
+ "syntax": "env( <ident> )"
959
+ },
930
960
  "-non-standard-display": {
931
961
  "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"
932
962
  },