@projectwallace/css-parser 0.18.5 → 0.18.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.
@@ -18,6 +18,7 @@ declare const PARENTHESIS = 17;
18
18
  declare const URL = 18;
19
19
  declare const UNICODE_RANGE = 19;
20
20
  declare const IF_BRANCH = 59;
21
+ declare const IF_CONDITION = 60;
21
22
  declare const SELECTOR_LIST = 20;
22
23
  declare const TYPE_SELECTOR = 21;
23
24
  declare const CLASS_SELECTOR = 22;
@@ -96,4 +97,4 @@ declare class CSSDataArena {
96
97
  has_flag(node_index: number, flag: number): boolean;
97
98
  }
98
99
  //#endregion
99
- export { PRELUDE_OPERATOR as A, STYLE_RULE as B, MEDIA_TYPE as C, NUMBER as D, NTH_SELECTOR as E, RAW as F, UNIVERSAL_SELECTOR as G, SUPPORTS_QUERY as H, SELECTOR as I, URL as K, SELECTOR_LIST as L, PSEUDO_CLASS_SELECTOR as M, PSEUDO_ELEMENT_SELECTOR as N, OPERATOR as O, RATIO as P, STRING as R, MEDIA_QUERY as S, NTH_OF_SELECTOR as T, TYPE_SELECTOR as U, SUPPORTS_DECLARATION as V, UNICODE_RANGE as W, ID_SELECTOR as _, CLASS_SELECTOR as a, LAYER_NAME as b, CONTAINER_QUERY as c, DIMENSION as d, FEATURE_RANGE as f, IDENTIFIER as g, HASH as h, BLOCK as i, PRELUDE_SELECTORLIST as j, PARENTHESIS as k, CSSDataArena as l, FUNCTION as m, AT_RULE as n, COMBINATOR as o, FLAG_IMPORTANT as p, VALUE as q, AT_RULE_PRELUDE as r, COMMENT as s, ATTRIBUTE_SELECTOR as t, DECLARATION as u, IF_BRANCH as v, NESTING_SELECTOR as w, MEDIA_FEATURE as x, LANG_SELECTOR as y, STYLESHEET as z };
100
+ export { PARENTHESIS as A, STYLESHEET as B, MEDIA_QUERY as C, NTH_SELECTOR as D, NTH_OF_SELECTOR as E, RATIO as F, UNICODE_RANGE as G, SUPPORTS_DECLARATION as H, RAW as I, VALUE as J, UNIVERSAL_SELECTOR as K, SELECTOR as L, PRELUDE_SELECTORLIST as M, PSEUDO_CLASS_SELECTOR as N, NUMBER as O, PSEUDO_ELEMENT_SELECTOR as P, SELECTOR_LIST as R, MEDIA_FEATURE as S, NESTING_SELECTOR as T, SUPPORTS_QUERY as U, STYLE_RULE as V, TYPE_SELECTOR as W, ID_SELECTOR as _, CLASS_SELECTOR as a, LANG_SELECTOR as b, CONTAINER_QUERY as c, DIMENSION as d, FEATURE_RANGE as f, IDENTIFIER as g, HASH as h, BLOCK as i, PRELUDE_OPERATOR as j, OPERATOR as k, CSSDataArena as l, FUNCTION as m, AT_RULE as n, COMBINATOR as o, FLAG_IMPORTANT as p, URL as q, AT_RULE_PRELUDE as r, COMMENT as s, ATTRIBUTE_SELECTOR as t, DECLARATION as u, IF_BRANCH as v, MEDIA_TYPE as w, LAYER_NAME as x, IF_CONDITION as y, STRING as z };
@@ -19,6 +19,7 @@ const PARENTHESIS = 17;
19
19
  const URL = 18;
20
20
  const UNICODE_RANGE = 19;
21
21
  const IF_BRANCH = 59;
22
+ const IF_CONDITION = 60;
22
23
  const SELECTOR_LIST = 20;
23
24
  const TYPE_SELECTOR = 21;
24
25
  const CLASS_SELECTOR = 22;
@@ -218,4 +219,4 @@ var CSSDataArena = class CSSDataArena {
218
219
  }
219
220
  };
220
221
  //#endregion
221
- export { PRELUDE_OPERATOR as A, SUPPORTS_DECLARATION as B, MEDIA_TYPE as C, NUMBER as D, NTH_SELECTOR as E, SELECTOR as F, URL as G, TYPE_SELECTOR as H, SELECTOR_LIST as I, VALUE as K, STRING as L, PSEUDO_ELEMENT_SELECTOR as M, RATIO as N, OPERATOR as O, RAW as P, STYLESHEET as R, MEDIA_QUERY as S, NTH_OF_SELECTOR as T, UNICODE_RANGE as U, SUPPORTS_QUERY as V, UNIVERSAL_SELECTOR as W, ID_SELECTOR as _, CLASS_SELECTOR as a, LAYER_NAME as b, CONTAINER_QUERY as c, DIMENSION as d, FEATURE_RANGE as f, IDENTIFIER as g, HASH as h, BLOCK as i, PSEUDO_CLASS_SELECTOR as j, PARENTHESIS as k, CSSDataArena as l, FUNCTION as m, AT_RULE as n, COMBINATOR as o, FLAG_IMPORTANT as p, AT_RULE_PRELUDE as r, COMMENT as s, ATTRIBUTE_SELECTOR as t, DECLARATION as u, IF_BRANCH as v, NESTING_SELECTOR as w, MEDIA_FEATURE as x, LANG_SELECTOR as y, STYLE_RULE as z };
222
+ export { PARENTHESIS as A, STYLE_RULE as B, MEDIA_QUERY as C, NTH_SELECTOR as D, NTH_OF_SELECTOR as E, RAW as F, UNIVERSAL_SELECTOR as G, SUPPORTS_QUERY as H, SELECTOR as I, URL as K, SELECTOR_LIST as L, PSEUDO_CLASS_SELECTOR as M, PSEUDO_ELEMENT_SELECTOR as N, NUMBER as O, RATIO as P, STRING as R, MEDIA_FEATURE as S, NESTING_SELECTOR as T, TYPE_SELECTOR as U, SUPPORTS_DECLARATION as V, UNICODE_RANGE as W, ID_SELECTOR as _, CLASS_SELECTOR as a, LANG_SELECTOR as b, CONTAINER_QUERY as c, DIMENSION as d, FEATURE_RANGE as f, IDENTIFIER as g, HASH as h, BLOCK as i, PRELUDE_OPERATOR as j, OPERATOR as k, CSSDataArena as l, FUNCTION as m, AT_RULE as n, COMBINATOR as o, FLAG_IMPORTANT as p, VALUE as q, AT_RULE_PRELUDE as r, COMMENT as s, ATTRIBUTE_SELECTOR as t, DECLARATION as u, IF_BRANCH as v, MEDIA_TYPE as w, LAYER_NAME as x, IF_CONDITION as y, STYLESHEET as z };
@@ -1,4 +1,4 @@
1
- import { A as PRELUDE_OPERATOR, B as STYLE_RULE, C as MEDIA_TYPE, D as NUMBER, E as NTH_SELECTOR, F as RAW, G as UNIVERSAL_SELECTOR, H as SUPPORTS_QUERY, I as SELECTOR, K as URL, L as SELECTOR_LIST, M as PSEUDO_CLASS_SELECTOR, N as PSEUDO_ELEMENT_SELECTOR, O as OPERATOR, P as RATIO, R as STRING, S as MEDIA_QUERY, T as NTH_OF_SELECTOR, U as TYPE_SELECTOR, V as SUPPORTS_DECLARATION, W as UNICODE_RANGE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LAYER_NAME, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, k as PARENTHESIS, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as VALUE, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as NESTING_SELECTOR, x as MEDIA_FEATURE, y as LANG_SELECTOR, z as STYLESHEET } from "./arena-DcrS77hW.js";
1
+ import { A as PARENTHESIS, B as STYLESHEET, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RATIO, G as UNICODE_RANGE, H as SUPPORTS_DECLARATION, I as RAW, J as VALUE, K as UNIVERSAL_SELECTOR, L as SELECTOR, N as PSEUDO_CLASS_SELECTOR, O as NUMBER, P as PSEUDO_ELEMENT_SELECTOR, R as SELECTOR_LIST, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as SUPPORTS_QUERY, V as STYLE_RULE, W as TYPE_SELECTOR, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as URL, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STRING } from "./arena-BGvFdbj5.js";
2
2
  //#region src/constants.d.ts
3
3
  declare const NODE_TYPES: {
4
4
  readonly STYLESHEET: 1;
@@ -20,6 +20,7 @@ declare const NODE_TYPES: {
20
20
  readonly URL: 18;
21
21
  readonly UNICODE_RANGE: 19;
22
22
  readonly IF_BRANCH: 59;
23
+ readonly IF_CONDITION: 60;
23
24
  readonly VALUE: 50;
24
25
  readonly SELECTOR_LIST: 20;
25
26
  readonly TYPE_SELECTOR: 21;
@@ -47,4 +48,4 @@ declare const NODE_TYPES: {
47
48
  readonly RATIO: 58;
48
49
  };
49
50
  //#endregion
50
- export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, IF_BRANCH, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RATIO, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
51
+ export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, IF_BRANCH, IF_CONDITION, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RATIO, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
package/dist/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as PRELUDE_OPERATOR, B as SUPPORTS_DECLARATION, C as MEDIA_TYPE, D as NUMBER, E as NTH_SELECTOR, F as SELECTOR, G as URL, H as TYPE_SELECTOR, I as SELECTOR_LIST, K as VALUE, L as STRING, M as PSEUDO_ELEMENT_SELECTOR, N as RATIO, O as OPERATOR, P as RAW, R as STYLESHEET, S as MEDIA_QUERY, T as NTH_OF_SELECTOR, U as UNICODE_RANGE, V as SUPPORTS_QUERY, W as UNIVERSAL_SELECTOR, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LAYER_NAME, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PSEUDO_CLASS_SELECTOR, k as PARENTHESIS, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as NESTING_SELECTOR, x as MEDIA_FEATURE, y as LANG_SELECTOR, z as STYLE_RULE } from "./arena-DKhfTFT5.js";
1
+ import { A as PARENTHESIS, B as STYLE_RULE, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RAW, G as UNIVERSAL_SELECTOR, H as SUPPORTS_QUERY, I as SELECTOR, K as URL, L as SELECTOR_LIST, M as PSEUDO_CLASS_SELECTOR, N as PSEUDO_ELEMENT_SELECTOR, O as NUMBER, P as RATIO, R as STRING, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as TYPE_SELECTOR, V as SUPPORTS_DECLARATION, W as UNICODE_RANGE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as VALUE, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STYLESHEET } from "./arena-e9O_g2AN.js";
2
2
  //#region src/constants.ts
3
3
  const NODE_TYPES = {
4
4
  STYLESHEET: 1,
@@ -20,6 +20,7 @@ const NODE_TYPES = {
20
20
  URL: 18,
21
21
  UNICODE_RANGE: 19,
22
22
  IF_BRANCH: 59,
23
+ IF_CONDITION: 60,
23
24
  VALUE: 50,
24
25
  SELECTOR_LIST: 20,
25
26
  TYPE_SELECTOR: 21,
@@ -47,4 +48,4 @@ const NODE_TYPES = {
47
48
  RATIO: 58
48
49
  };
49
50
  //#endregion
50
- export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, IF_BRANCH, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RATIO, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
51
+ export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, IF_BRANCH, IF_CONDITION, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RATIO, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
@@ -1,4 +1,4 @@
1
- import "./arena-DKhfTFT5.js";
1
+ import "./arena-e9O_g2AN.js";
2
2
  import { a as is_whitespace, c as str_starts_with, i as is_vendor_prefixed, o as str_equals, t as parse_dimension } from "./parse-dimension-ouWXNHdx.js";
3
3
  //#region src/css-node.ts
4
4
  const TYPE_NAMES = {
@@ -46,7 +46,8 @@ const TYPE_NAMES = {
46
46
  [40]: "AtrulePrelude",
47
47
  [41]: "PreludeSelectorList",
48
48
  [58]: "Ratio",
49
- [59]: "IfBranch"
49
+ [59]: "IfBranch",
50
+ [60]: "IfCondition"
50
51
  };
51
52
  const nodes_with_name = /* @__PURE__ */ new Set([
52
53
  3,
@@ -81,7 +82,8 @@ const nodes_with_children = /* @__PURE__ */ new Set([
81
82
  39,
82
83
  36,
83
84
  57,
84
- 59
85
+ 59,
86
+ 60
85
87
  ]);
86
88
  const enumerable_properties = [
87
89
  "name",
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { A as PRELUDE_OPERATOR, B as STYLE_RULE, C as MEDIA_TYPE, D as NUMBER, E as NTH_SELECTOR, F as RAW, G as UNIVERSAL_SELECTOR, H as SUPPORTS_QUERY, I as SELECTOR, K as URL, L as SELECTOR_LIST, M as PSEUDO_CLASS_SELECTOR, N as PSEUDO_ELEMENT_SELECTOR, O as OPERATOR, P as RATIO, R as STRING, S as MEDIA_QUERY, T as NTH_OF_SELECTOR, U as TYPE_SELECTOR, V as SUPPORTS_DECLARATION, W as UNICODE_RANGE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LAYER_NAME, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, k as PARENTHESIS, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as VALUE, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as NESTING_SELECTOR, x as MEDIA_FEATURE, y as LANG_SELECTOR, z as STYLESHEET } from "./arena-DcrS77hW.js";
1
+ import { A as PARENTHESIS, B as STYLESHEET, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RATIO, G as UNICODE_RANGE, H as SUPPORTS_DECLARATION, I as RAW, J as VALUE, K as UNIVERSAL_SELECTOR, L as SELECTOR, N as PSEUDO_CLASS_SELECTOR, O as NUMBER, P as PSEUDO_ELEMENT_SELECTOR, R as SELECTOR_LIST, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as SUPPORTS_QUERY, V as STYLE_RULE, W as TYPE_SELECTOR, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as URL, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STRING } from "./arena-BGvFdbj5.js";
2
2
  import { NODE_TYPES } from "./constants.js";
3
3
  import { A as TOKEN_URL, C as TOKEN_PERCENTAGE, D as TOKEN_SEMICOLON, E as TOKEN_RIGHT_PAREN, M as Token, N as TokenType, O as TOKEN_STRING, S as TOKEN_NUMBER, T as TOKEN_RIGHT_BRACKET, _ as TOKEN_HASH, a as TOKEN_AT_KEYWORD, b as TOKEN_LEFT_BRACKET, c as TOKEN_CDC, d as TOKEN_COMMA, f as TOKEN_COMMENT, g as TOKEN_FUNCTION, h as TOKEN_EOF, i as tokenize, j as TOKEN_WHITESPACE, k as TOKEN_UNICODE_RANGE, l as TOKEN_CDO, m as TOKEN_DIMENSION, o as TOKEN_BAD_STRING, p as TOKEN_DELIM, r as LexerPosition, s as TOKEN_BAD_URL, t as CommentInfo, u as TOKEN_COLON, v as TOKEN_IDENT, w as TOKEN_RIGHT_BRACE, x as TOKEN_LEFT_PAREN, y as TOKEN_LEFT_BRACE } from "./tokenize-CDEnYcVG.js";
4
- import { $ as is_attribute_selector, A as PreludeOperator, At as is_rule, B as String, Bt as is_url, C as MediaType, Ct as is_parenthesis, D as Number, Dt as is_pseudo_element_selector, E as NthSelector, Et as is_pseudo_class_selector, F as Raw, Ft as is_supports_declaration, G as TypeSelector, H as SupportsDeclaration, Ht as CloneOptions, I as Rule, It as is_supports_query, J as Url, K as UnicodeRange, L as Selector, Lt as is_type_selector, M as PseudoClassSelector, Mt as is_selector_list, N as PseudoElementSelector, Nt as is_string, O as Operator, Ot as is_ratio, P as Ratio, Pt as is_stylesheet, Q as is_atrule_prelude, R as SelectorList, Rt as is_unicode_range, S as MediaQuery, St as is_operator, T as NthOfSelector, Tt as is_prelude_selectorlist, U as SupportsQuery, Ut as PlainCSSNode, V as StyleSheet, Vt as is_value, W as ToPlain, Wt as TYPE_NAMES, X as WithChildren, Y as Value, Z as is_atrule, _ as Identifier, _t as is_media_type, a as Block, at as is_declaration, b as LayerName, bt as is_nth_selector, c as Combinator, ct as is_function, d as Declaration, dt as is_identifier, et as is_block, f as Dimension, ft as is_if_branch, g as IdSelector, gt as is_media_query, h as Hash, ht as is_media_feature, i as AttributeSelector, it as is_container_query, j as PreludeSelectorList, jt as is_selector, k as Parenthesis, kt as is_raw, l as Comment, lt as is_hash, m as Function, mt as is_layer_name, n as Atrule, nt as is_combinator, o as CSSNode, ot as is_dimension, p as FeatureRange, pt as is_lang_selector, q as UniversalSelector, r as AtrulePrelude, rt as is_comment, s as ClassSelector, st as is_feature_range, t as AnyNode, tt as is_class_selector, u as ContainerQuery, ut as is_id_selector, v as IfBranch, vt as is_nesting_selector, w as NestingSelector, wt as is_prelude_operator, x as MediaFeature, xt as is_number, y as LangSelector, yt as is_nth_of_selector, z as SelectorNode, zt as is_universal_selector } from "./node-types-u3Sbl3_p.js";
4
+ import { $ as is_atrule_prelude, A as Parenthesis, At as is_ratio, B as SelectorNode, Bt as is_unicode_range, C as MediaQuery, Ct as is_number, D as NthSelector, Dt as is_prelude_selectorlist, E as NthOfSelector, Et as is_prelude_operator, F as Ratio, Ft as is_string, G as ToPlain, Gt as PlainCSSNode, H as StyleSheet, Ht as is_url, I as Raw, It as is_stylesheet, J as UniversalSelector, K as TypeSelector, Kt as TYPE_NAMES, L as Rule, Lt as is_supports_declaration, M as PreludeSelectorList, Mt as is_rule, N as PseudoClassSelector, Nt as is_selector, O as Number, Ot as is_pseudo_class_selector, P as PseudoElementSelector, Pt as is_selector_list, Q as is_atrule, R as Selector, Rt as is_supports_query, S as MediaFeature, St as is_nth_selector, T as NestingSelector, Tt as is_parenthesis, U as SupportsDeclaration, Ut as is_value, V as String, Vt as is_universal_selector, W as SupportsQuery, Wt as CloneOptions, X as Value, Y as Url, Z as WithChildren, _ as Identifier, _t as is_media_feature, a as Block, at as is_container_query, b as LangSelector, bt as is_nesting_selector, c as Combinator, ct as is_feature_range, d as Declaration, dt as is_id_selector, et as is_attribute_selector, f as Dimension, ft as is_identifier, g as IdSelector, gt as is_layer_name, h as Hash, ht as is_lang_selector, i as AttributeSelector, it as is_comment, j as PreludeOperator, jt as is_raw, k as Operator, kt as is_pseudo_element_selector, l as Comment, lt as is_function, m as Function, mt as is_if_condition, n as Atrule, nt as is_class_selector, o as CSSNode, ot as is_declaration, p as FeatureRange, pt as is_if_branch, q as UnicodeRange, r as AtrulePrelude, rt as is_combinator, s as ClassSelector, st as is_dimension, t as AnyNode, tt as is_block, u as ContainerQuery, ut as is_hash, v as IfBranch, vt as is_media_query, w as MediaType, wt as is_operator, x as LayerName, xt as is_nth_of_selector, y as IfCondition, yt as is_media_type, z as SelectorList, zt as is_type_selector } from "./node-types-YnOKcNfU.js";
5
5
  import { ParserOptions, parse } from "./parse.js";
6
6
  import { parse_selector, parse_selector_list } from "./parse-selector.js";
7
7
  import { parse_atrule_prelude } from "./parse-atrule-prelude.js";
@@ -25,4 +25,4 @@ declare function is_vendor_prefixed(source: string, start: number, end: number):
25
25
  /** True if the string is a CSS custom property (starts with `--`). */
26
26
  declare function is_custom(str: string): boolean;
27
27
  //#endregion
28
- export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, type AnyNode, type Atrule, type AtrulePrelude, type AttributeSelector, BLOCK, BREAK, type Block, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, type CSSNode, type ClassSelector, type CloneOptions, type Combinator, type Comment, type CommentInfo, type ContainerQuery, DECLARATION, DIMENSION, type Declaration, type Dimension, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, type FeatureRange, type Function, HASH, type Hash, IDENTIFIER, ID_SELECTOR, IF_BRANCH, type IdSelector, type Identifier, type IfBranch, LANG_SELECTOR, LAYER_NAME, type LangSelector, type LayerName, type LexerPosition, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, type MediaFeature, type MediaQuery, type MediaType, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, type NestingSelector, type NthOfSelector, type NthSelector, type Number, OPERATOR, type Operator, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, type Parenthesis, type ParserOptions, type PlainCSSNode, type PreludeOperator, type PreludeSelectorList, type PseudoClassSelector, type PseudoElementSelector, RATIO, RAW, type Ratio, type Raw, type Rule, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, type Selector, type SelectorList, type SelectorNode, type String, type StyleSheet, type SupportsDeclaration, type SupportsQuery, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, type ToPlain, Token, TokenType, type TypeSelector, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, type UnicodeRange, type UniversalSelector, type Url, VALUE, type Value, type WithChildren, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_if_branch, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_ratio, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_declaration, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_selector_list, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
28
+ export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, type AnyNode, type Atrule, type AtrulePrelude, type AttributeSelector, BLOCK, BREAK, type Block, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, type CSSNode, type ClassSelector, type CloneOptions, type Combinator, type Comment, type CommentInfo, type ContainerQuery, DECLARATION, DIMENSION, type Declaration, type Dimension, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, type FeatureRange, type Function, HASH, type Hash, IDENTIFIER, ID_SELECTOR, IF_BRANCH, IF_CONDITION, type IdSelector, type Identifier, type IfBranch, type IfCondition, LANG_SELECTOR, LAYER_NAME, type LangSelector, type LayerName, type LexerPosition, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, type MediaFeature, type MediaQuery, type MediaType, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, type NestingSelector, type NthOfSelector, type NthSelector, type Number, OPERATOR, type Operator, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, type Parenthesis, type ParserOptions, type PlainCSSNode, type PreludeOperator, type PreludeSelectorList, type PseudoClassSelector, type PseudoElementSelector, RATIO, RAW, type Ratio, type Raw, type Rule, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, type Selector, type SelectorList, type SelectorNode, type String, type StyleSheet, type SupportsDeclaration, type SupportsQuery, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, type ToPlain, Token, TokenType, type TypeSelector, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, type UnicodeRange, type UniversalSelector, type Url, VALUE, type Value, type WithChildren, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_if_branch, is_if_condition, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_ratio, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_declaration, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_selector_list, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { C as TOKEN_RIGHT_BRACKET, D as TOKEN_UNICODE_RANGE, E as TOKEN_STRING, O as TOKEN_URL, S as TOKEN_RIGHT_BRACE, T as TOKEN_SEMICOLON, _ as TOKEN_LEFT_BRACE, a as TOKEN_BAD_URL, b as TOKEN_NUMBER, c as TOKEN_COLON, d as TOKEN_DELIM, f as TOKEN_DIMENSION, g as TOKEN_IDENT, h as TOKEN_HASH, i as TOKEN_BAD_STRING, k as TOKEN_WHITESPACE, l as TOKEN_COMMA, m as TOKEN_FUNCTION, n as tokenize, o as TOKEN_CDC, p as TOKEN_EOF, r as TOKEN_AT_KEYWORD, s as TOKEN_CDO, u as TOKEN_COMMENT, v as TOKEN_LEFT_BRACKET, w as TOKEN_RIGHT_PAREN, x as TOKEN_PERCENTAGE, y as TOKEN_LEFT_PAREN } from "./tokenize-DK24ACbY.js";
2
- import { A as PRELUDE_OPERATOR, B as SUPPORTS_DECLARATION, C as MEDIA_TYPE, D as NUMBER, E as NTH_SELECTOR, F as SELECTOR, G as URL, H as TYPE_SELECTOR, I as SELECTOR_LIST, K as VALUE, L as STRING, M as PSEUDO_ELEMENT_SELECTOR, N as RATIO, O as OPERATOR, P as RAW, R as STYLESHEET, S as MEDIA_QUERY, T as NTH_OF_SELECTOR, U as UNICODE_RANGE, V as SUPPORTS_QUERY, W as UNIVERSAL_SELECTOR, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LAYER_NAME, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PSEUDO_CLASS_SELECTOR, k as PARENTHESIS, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as NESTING_SELECTOR, x as MEDIA_FEATURE, y as LANG_SELECTOR, z as STYLE_RULE } from "./arena-DKhfTFT5.js";
2
+ import { A as PARENTHESIS, B as STYLE_RULE, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RAW, G as UNIVERSAL_SELECTOR, H as SUPPORTS_QUERY, I as SELECTOR, K as URL, L as SELECTOR_LIST, M as PSEUDO_CLASS_SELECTOR, N as PSEUDO_ELEMENT_SELECTOR, O as NUMBER, P as RATIO, R as STRING, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as TYPE_SELECTOR, V as SUPPORTS_DECLARATION, W as UNICODE_RANGE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as VALUE, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STYLESHEET } from "./arena-e9O_g2AN.js";
3
3
  import { c as str_starts_with, i as is_vendor_prefixed, o as str_equals, r as is_custom, s as str_index_of, t as parse_dimension } from "./parse-dimension-ouWXNHdx.js";
4
- import { n as TYPE_NAMES } from "./css-node-DKr6cufe.js";
5
- import { n as parse_selector, r as parse_selector_list } from "./parse-selector-DBdUc04T.js";
4
+ import { n as TYPE_NAMES } from "./css-node-BmD2JJLr.js";
5
+ import { n as parse_selector, r as parse_selector_list } from "./parse-selector-DMduLN4o.js";
6
6
  import { parse_atrule_prelude } from "./parse-atrule-prelude.js";
7
7
  import { parse_value } from "./parse-value.js";
8
8
  import { parse_declaration } from "./parse-declaration.js";
@@ -70,6 +70,9 @@ function is_unicode_range(node) {
70
70
  function is_if_branch(node) {
71
71
  return node.type === 59;
72
72
  }
73
+ function is_if_condition(node) {
74
+ return node.type === 60;
75
+ }
73
76
  function is_value(node) {
74
77
  return node.type === 50;
75
78
  }
@@ -146,4 +149,4 @@ function is_prelude_selectorlist(node) {
146
149
  return node.type === 41;
147
150
  }
148
151
  //#endregion
149
- export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, BREAK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, IF_BRANCH, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RATIO, RAW, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_if_branch, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_ratio, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_declaration, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_selector_list, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
152
+ export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, BREAK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, IF_BRANCH, IF_CONDITION, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RATIO, RAW, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_if_branch, is_if_condition, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_ratio, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_declaration, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_selector_list, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
@@ -1,4 +1,4 @@
1
- import { A as PRELUDE_OPERATOR, B as STYLE_RULE, C as MEDIA_TYPE, D as NUMBER, E as NTH_SELECTOR, F as RAW, G as UNIVERSAL_SELECTOR, H as SUPPORTS_QUERY, I as SELECTOR, K as URL, L as SELECTOR_LIST, M as PSEUDO_CLASS_SELECTOR, N as PSEUDO_ELEMENT_SELECTOR, O as OPERATOR, P as RATIO, R as STRING, S as MEDIA_QUERY, T as NTH_OF_SELECTOR, U as TYPE_SELECTOR, V as SUPPORTS_DECLARATION, W as UNICODE_RANGE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LAYER_NAME, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_SELECTORLIST, k as PARENTHESIS, m as FUNCTION, n as AT_RULE, o as COMBINATOR, q as VALUE, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as NESTING_SELECTOR, x as MEDIA_FEATURE, y as LANG_SELECTOR, z as STYLESHEET } from "./arena-DcrS77hW.js";
1
+ import { A as PARENTHESIS, B as STYLESHEET, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RATIO, G as UNICODE_RANGE, H as SUPPORTS_DECLARATION, I as RAW, J as VALUE, K as UNIVERSAL_SELECTOR, L as SELECTOR, M as PRELUDE_SELECTORLIST, N as PSEUDO_CLASS_SELECTOR, O as NUMBER, P as PSEUDO_ELEMENT_SELECTOR, R as SELECTOR_LIST, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as SUPPORTS_QUERY, V as STYLE_RULE, W as TYPE_SELECTOR, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, q as URL, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STRING } from "./arena-BGvFdbj5.js";
2
2
  //#region src/css-node.d.ts
3
3
  declare const TYPE_NAMES: {
4
4
  readonly 1: 'StyleSheet';
@@ -46,9 +46,10 @@ declare const TYPE_NAMES: {
46
46
  readonly 41: 'PreludeSelectorList';
47
47
  readonly 58: 'Ratio';
48
48
  readonly 59: 'IfBranch';
49
+ readonly 60: 'IfCondition';
49
50
  };
50
51
  type TypeName = (typeof TYPE_NAMES)[keyof typeof TYPE_NAMES] | 'unknown';
51
- type CSSNodeType = typeof STYLESHEET | typeof STYLE_RULE | typeof AT_RULE | typeof DECLARATION | typeof SELECTOR | typeof COMMENT | typeof BLOCK | typeof RAW | typeof IDENTIFIER | typeof NUMBER | typeof DIMENSION | typeof STRING | typeof HASH | typeof FUNCTION | typeof OPERATOR | typeof PARENTHESIS | typeof URL | typeof UNICODE_RANGE | typeof VALUE | typeof SELECTOR_LIST | typeof TYPE_SELECTOR | typeof CLASS_SELECTOR | typeof ID_SELECTOR | typeof ATTRIBUTE_SELECTOR | typeof PSEUDO_CLASS_SELECTOR | typeof PSEUDO_ELEMENT_SELECTOR | typeof COMBINATOR | typeof UNIVERSAL_SELECTOR | typeof NESTING_SELECTOR | typeof NTH_SELECTOR | typeof NTH_OF_SELECTOR | typeof LANG_SELECTOR | typeof MEDIA_QUERY | typeof MEDIA_FEATURE | typeof MEDIA_TYPE | typeof CONTAINER_QUERY | typeof SUPPORTS_QUERY | typeof LAYER_NAME | typeof PRELUDE_OPERATOR | typeof FEATURE_RANGE | typeof AT_RULE_PRELUDE | typeof PRELUDE_SELECTORLIST | typeof SUPPORTS_DECLARATION | typeof RATIO | typeof IF_BRANCH;
52
+ type CSSNodeType = typeof STYLESHEET | typeof STYLE_RULE | typeof AT_RULE | typeof DECLARATION | typeof SELECTOR | typeof COMMENT | typeof BLOCK | typeof RAW | typeof IDENTIFIER | typeof NUMBER | typeof DIMENSION | typeof STRING | typeof HASH | typeof FUNCTION | typeof OPERATOR | typeof PARENTHESIS | typeof URL | typeof UNICODE_RANGE | typeof VALUE | typeof SELECTOR_LIST | typeof TYPE_SELECTOR | typeof CLASS_SELECTOR | typeof ID_SELECTOR | typeof ATTRIBUTE_SELECTOR | typeof PSEUDO_CLASS_SELECTOR | typeof PSEUDO_ELEMENT_SELECTOR | typeof COMBINATOR | typeof UNIVERSAL_SELECTOR | typeof NESTING_SELECTOR | typeof NTH_SELECTOR | typeof NTH_OF_SELECTOR | typeof LANG_SELECTOR | typeof MEDIA_QUERY | typeof MEDIA_FEATURE | typeof MEDIA_TYPE | typeof CONTAINER_QUERY | typeof SUPPORTS_QUERY | typeof LAYER_NAME | typeof PRELUDE_OPERATOR | typeof FEATURE_RANGE | typeof AT_RULE_PRELUDE | typeof PRELUDE_SELECTORLIST | typeof SUPPORTS_DECLARATION | typeof RATIO | typeof IF_BRANCH | typeof IF_CONDITION;
52
53
  interface CloneOptions {
53
54
  /**
54
55
  * Recursively clone all children
@@ -242,23 +243,37 @@ type Value = WithClone<CSSNode & WithChildren<ValueLike> & {
242
243
  readonly type: typeof VALUE;
243
244
  readonly type_name: 'Value';
244
245
  }>;
246
+ /**
247
+ * A compound `if()`-branch condition combining multiple tests with `not`/`and`/`or`,
248
+ * e.g. `not style(--scheme: light)` or `style(--a: 1) and media(width > 600px)`.
249
+ *
250
+ * Children are the flat sequence of PreludeOperator ("not"/"and"/"or") and
251
+ * Function (`style()`/`media()`/`supports()`) nodes, in source order — the same
252
+ * shape `@supports`'s own compound condition uses.
253
+ */
254
+ type IfCondition = WithClone<CSSNode & WithChildren<Function | PreludeOperator> & {
255
+ readonly type: typeof IF_CONDITION;
256
+ readonly type_name: 'IfCondition';
257
+ }>;
245
258
  /**
246
259
  * One branch inside a CSS `if()` inline conditional function.
247
260
  *
248
261
  * Each branch corresponds to a `<condition>: <value>` pair in:
249
262
  * `if( <condition>: <value>; … else: <fallback> )`
250
263
  *
251
- * - `condition` — the parsed condition node (Function, e.g. `style(--x: 1)`, or Identifier `else`)
264
+ * - `condition` — the parsed condition node: a Function (e.g. `style(--x: 1)`), an
265
+ * Identifier (`else`), or an IfCondition for compound `not`/`and`/`or` conditions
266
+ * (e.g. `not style(--x: 1)`)
252
267
  * - `value` — the value text, e.g. `"green"`; `null` when omitted
253
268
  * - `is_else` — `true` for the `else` branch
254
269
  * - `first_child` — same node as `condition`
255
270
  * - `children` — condition node followed by parsed value nodes
256
271
  */
257
- type IfBranch = CSSNode & WithChildren<Function | Identifier | Value> & {
272
+ type IfBranch = CSSNode & WithChildren<Function | Identifier | IfCondition | Value> & {
258
273
  readonly type: typeof IF_BRANCH;
259
274
  readonly type_name: 'IfBranch';
260
- /** The parsed condition node, e.g. the Function "style(--active: 1)" or the Identifier "else" */
261
- readonly condition: Function | Identifier;
275
+ /** The parsed condition node, e.g. the Function "style(--active: 1)", the Identifier "else", or an IfCondition for compound conditions */
276
+ readonly condition: Function | Identifier | IfCondition;
262
277
  /** The parsed value as a VALUE node, or null when the branch value is empty */
263
278
  readonly value: Value | null;
264
279
  /** True when this is the else branch */
@@ -385,7 +400,7 @@ type FeatureRange = WithClone<CSSNode & WithChildren<Dimension | PreludeOperator
385
400
  /** The feature name in a range comparison, e.g. "width" from "(width >= 400px)" */
386
401
  readonly name: string;
387
402
  }>;
388
- type AnyNode = StyleSheet | Rule | Atrule | Declaration | Selector | SelectorList | Block | Comment | Raw | Identifier | Number | Dimension | Ratio | String | Hash | Function | Operator | Parenthesis | Url | UnicodeRange | IfBranch | Value | TypeSelector | ClassSelector | IdSelector | AttributeSelector | PseudoClassSelector | PseudoElementSelector | Combinator | UniversalSelector | NestingSelector | NthSelector | NthOfSelector | LangSelector | AtrulePrelude | MediaQuery | MediaFeature | MediaType | ContainerQuery | SupportsQuery | SupportsDeclaration | LayerName | PreludeOperator | FeatureRange | PreludeSelectorList;
403
+ type AnyNode = StyleSheet | Rule | Atrule | Declaration | Selector | SelectorList | Block | Comment | Raw | Identifier | Number | Dimension | Ratio | String | Hash | Function | Operator | Parenthesis | Url | UnicodeRange | IfBranch | IfCondition | Value | TypeSelector | ClassSelector | IdSelector | AttributeSelector | PseudoClassSelector | PseudoElementSelector | Combinator | UniversalSelector | NestingSelector | NthSelector | NthOfSelector | LangSelector | AtrulePrelude | MediaQuery | MediaFeature | MediaType | ContainerQuery | SupportsQuery | SupportsDeclaration | LayerName | PreludeOperator | FeatureRange | PreludeSelectorList;
389
404
  declare function is_stylesheet(node: CSSNode): node is StyleSheet;
390
405
  declare function is_rule(node: CSSNode): node is Rule;
391
406
  declare function is_atrule(node: CSSNode): node is Atrule;
@@ -406,6 +421,7 @@ declare function is_parenthesis(node: CSSNode): node is Parenthesis;
406
421
  declare function is_url(node: CSSNode): node is Url;
407
422
  declare function is_unicode_range(node: CSSNode): node is UnicodeRange;
408
423
  declare function is_if_branch(node: CSSNode): node is IfBranch;
424
+ declare function is_if_condition(node: CSSNode): node is IfCondition;
409
425
  declare function is_value(node: CSSNode): node is Value;
410
426
  declare function is_type_selector(node: CSSNode): node is TypeSelector;
411
427
  declare function is_class_selector(node: CSSNode): node is ClassSelector;
@@ -432,4 +448,4 @@ declare function is_feature_range(node: CSSNode): node is FeatureRange;
432
448
  declare function is_ratio(node: CSSNode): node is Ratio;
433
449
  declare function is_prelude_selectorlist(node: CSSNode): node is PreludeSelectorList;
434
450
  //#endregion
435
- export { is_attribute_selector as $, PreludeOperator as A, is_rule as At, String as B, is_url as Bt, MediaType as C, is_parenthesis as Ct, Number as D, is_pseudo_element_selector as Dt, NthSelector as E, is_pseudo_class_selector as Et, Raw as F, is_supports_declaration as Ft, TypeSelector as G, SupportsDeclaration as H, CloneOptions as Ht, Rule as I, is_supports_query as It, Url as J, UnicodeRange as K, Selector as L, is_type_selector as Lt, PseudoClassSelector as M, is_selector_list as Mt, PseudoElementSelector as N, is_string as Nt, Operator as O, is_ratio as Ot, Ratio as P, is_stylesheet as Pt, is_atrule_prelude as Q, SelectorList as R, is_unicode_range as Rt, MediaQuery as S, is_operator as St, NthOfSelector as T, is_prelude_selectorlist as Tt, SupportsQuery as U, PlainCSSNode as Ut, StyleSheet as V, is_value as Vt, ToPlain as W, TYPE_NAMES as Wt, WithChildren as X, Value as Y, is_atrule as Z, Identifier as _, is_media_type as _t, Block as a, is_declaration as at, LayerName as b, is_nth_selector as bt, Combinator as c, is_function as ct, Declaration as d, is_identifier as dt, is_block as et, Dimension as f, is_if_branch as ft, IdSelector as g, is_media_query as gt, Hash as h, is_media_feature as ht, AttributeSelector as i, is_container_query as it, PreludeSelectorList as j, is_selector as jt, Parenthesis as k, is_raw as kt, Comment as l, is_hash as lt, Function as m, is_layer_name as mt, Atrule as n, is_combinator as nt, CSSNode as o, is_dimension as ot, FeatureRange as p, is_lang_selector as pt, UniversalSelector as q, AtrulePrelude as r, is_comment as rt, ClassSelector as s, is_feature_range as st, AnyNode as t, is_class_selector as tt, ContainerQuery as u, is_id_selector as ut, IfBranch as v, is_nesting_selector as vt, NestingSelector as w, is_prelude_operator as wt, MediaFeature as x, is_number as xt, LangSelector as y, is_nth_of_selector as yt, SelectorNode as z, is_universal_selector as zt };
451
+ export { is_atrule_prelude as $, Parenthesis as A, is_ratio as At, SelectorNode as B, is_unicode_range as Bt, MediaQuery as C, is_number as Ct, NthSelector as D, is_prelude_selectorlist as Dt, NthOfSelector as E, is_prelude_operator as Et, Ratio as F, is_string as Ft, ToPlain as G, PlainCSSNode as Gt, StyleSheet as H, is_url as Ht, Raw as I, is_stylesheet as It, UniversalSelector as J, TypeSelector as K, TYPE_NAMES as Kt, Rule as L, is_supports_declaration as Lt, PreludeSelectorList as M, is_rule as Mt, PseudoClassSelector as N, is_selector as Nt, Number as O, is_pseudo_class_selector as Ot, PseudoElementSelector as P, is_selector_list as Pt, is_atrule as Q, Selector as R, is_supports_query as Rt, MediaFeature as S, is_nth_selector as St, NestingSelector as T, is_parenthesis as Tt, SupportsDeclaration as U, is_value as Ut, String as V, is_universal_selector as Vt, SupportsQuery as W, CloneOptions as Wt, Value as X, Url as Y, WithChildren as Z, Identifier as _, is_media_feature as _t, Block as a, is_container_query as at, LangSelector as b, is_nesting_selector as bt, Combinator as c, is_feature_range as ct, Declaration as d, is_id_selector as dt, is_attribute_selector as et, Dimension as f, is_identifier as ft, IdSelector as g, is_layer_name as gt, Hash as h, is_lang_selector as ht, AttributeSelector as i, is_comment as it, PreludeOperator as j, is_raw as jt, Operator as k, is_pseudo_element_selector as kt, Comment as l, is_function as lt, Function as m, is_if_condition as mt, Atrule as n, is_class_selector as nt, CSSNode as o, is_declaration as ot, FeatureRange as p, is_if_branch as pt, UnicodeRange as q, AtrulePrelude as r, is_combinator as rt, ClassSelector as s, is_dimension as st, AnyNode as t, is_block as tt, ContainerQuery as u, is_hash as ut, IfBranch as v, is_media_query as vt, MediaType as w, is_operator as wt, LayerName as x, is_nth_of_selector as xt, IfCondition as y, is_media_type as yt, SelectorList as z, is_type_selector as zt };
@@ -1,5 +1,5 @@
1
- import { l as CSSDataArena } from "./arena-DcrS77hW.js";
2
- import { E as NthSelector } from "./node-types-u3Sbl3_p.js";
1
+ import { l as CSSDataArena } from "./arena-BGvFdbj5.js";
2
+ import { D as NthSelector } from "./node-types-YnOKcNfU.js";
3
3
  //#region src/parse-anplusb.d.ts
4
4
  /** @internal */
5
5
  declare class ANplusBParser {
@@ -1,7 +1,7 @@
1
1
  import { t as Lexer } from "./tokenize-DK24ACbY.js";
2
- import { l as CSSDataArena } from "./arena-DKhfTFT5.js";
2
+ import { l as CSSDataArena } from "./arena-e9O_g2AN.js";
3
3
  import { o as str_equals, s as str_index_of } from "./parse-dimension-ouWXNHdx.js";
4
- import { t as CSSNode } from "./css-node-DKr6cufe.js";
4
+ import { t as CSSNode } from "./css-node-BmD2JJLr.js";
5
5
  //#region src/parse-anplusb.ts
6
6
  /** @internal */
7
7
  var ANplusBParser = class {
@@ -1,5 +1,5 @@
1
- import { l as CSSDataArena } from "./arena-DcrS77hW.js";
2
- import { t as AnyNode } from "./node-types-u3Sbl3_p.js";
1
+ import { l as CSSDataArena } from "./arena-BGvFdbj5.js";
2
+ import { t as AnyNode } from "./node-types-YnOKcNfU.js";
3
3
  //#region src/parse-atrule-prelude.d.ts
4
4
  /** @internal */
5
5
  declare class AtRulePreludeParser {
@@ -1,9 +1,9 @@
1
1
  import { t as Lexer } from "./tokenize-DK24ACbY.js";
2
- import { l as CSSDataArena } from "./arena-DKhfTFT5.js";
2
+ import { l as CSSDataArena } from "./arena-e9O_g2AN.js";
3
3
  import { l as strip_vendor_prefix, o as str_equals } from "./parse-dimension-ouWXNHdx.js";
4
- import { t as CSSNode } from "./css-node-DKr6cufe.js";
5
- import { s as trim_boundaries } from "./parse-selector-DBdUc04T.js";
6
- import { n as ConditionParser, t as ValueNodeParser } from "./value-node-parser-JFFFJVX-.js";
4
+ import { t as CSSNode } from "./css-node-BmD2JJLr.js";
5
+ import { s as trim_boundaries } from "./parse-selector-DMduLN4o.js";
6
+ import { n as ConditionParser, t as ValueNodeParser } from "./value-node-parser-3ET5Z4Rf.js";
7
7
  //#region src/parse-atrule-prelude.ts
8
8
  /** @internal */
9
9
  var AtRulePreludeParser = class {
@@ -1,6 +1,6 @@
1
- import { l as CSSDataArena } from "./arena-DcrS77hW.js";
1
+ import { l as CSSDataArena } from "./arena-BGvFdbj5.js";
2
2
  import { n as Lexer } from "./tokenize-CDEnYcVG.js";
3
- import { d as Declaration } from "./node-types-u3Sbl3_p.js";
3
+ import { d as Declaration } from "./node-types-YnOKcNfU.js";
4
4
  //#region src/parse-declaration.d.ts
5
5
  /** @internal */
6
6
  declare class DeclarationParser {
@@ -1,8 +1,8 @@
1
1
  import { t as Lexer } from "./tokenize-DK24ACbY.js";
2
- import { l as CSSDataArena } from "./arena-DKhfTFT5.js";
2
+ import { l as CSSDataArena } from "./arena-e9O_g2AN.js";
3
3
  import { i as is_vendor_prefixed } from "./parse-dimension-ouWXNHdx.js";
4
- import { t as CSSNode } from "./css-node-DKr6cufe.js";
5
- import { a as skip_whitespace_and_comments_backward, s as trim_boundaries } from "./parse-selector-DBdUc04T.js";
4
+ import { t as CSSNode } from "./css-node-BmD2JJLr.js";
5
+ import { a as skip_whitespace_and_comments_backward, s as trim_boundaries } from "./parse-selector-DMduLN4o.js";
6
6
  import { ValueParser } from "./parse-value.js";
7
7
  //#region src/parse-declaration.ts
8
8
  /** @internal */
@@ -1,7 +1,7 @@
1
1
  import { t as Lexer } from "./tokenize-DK24ACbY.js";
2
- import { l as CSSDataArena } from "./arena-DKhfTFT5.js";
2
+ import { l as CSSDataArena } from "./arena-e9O_g2AN.js";
3
3
  import { a as is_whitespace, n as is_combinator, o as str_equals } from "./parse-dimension-ouWXNHdx.js";
4
- import { t as CSSNode } from "./css-node-DKr6cufe.js";
4
+ import { t as CSSNode } from "./css-node-BmD2JJLr.js";
5
5
  import { ANplusBParser } from "./parse-anplusb.js";
6
6
  //#region src/parse-utils.ts
7
7
  /** @internal */
@@ -1,5 +1,5 @@
1
- import { l as CSSDataArena } from "./arena-DcrS77hW.js";
2
- import { L as Selector, R as SelectorList } from "./node-types-u3Sbl3_p.js";
1
+ import { l as CSSDataArena } from "./arena-BGvFdbj5.js";
2
+ import { R as Selector, z as SelectorList } from "./node-types-YnOKcNfU.js";
3
3
  //#region src/parse-selector.d.ts
4
4
  /** @internal */
5
5
  declare class SelectorParser {
@@ -1,2 +1,2 @@
1
- import { n as parse_selector, r as parse_selector_list, t as SelectorParser } from "./parse-selector-DBdUc04T.js";
1
+ import { n as parse_selector, r as parse_selector_list, t as SelectorParser } from "./parse-selector-DMduLN4o.js";
2
2
  export { SelectorParser, parse_selector, parse_selector_list };
@@ -1,5 +1,5 @@
1
- import { l as CSSDataArena } from "./arena-DcrS77hW.js";
2
- import { Y as Value } from "./node-types-u3Sbl3_p.js";
1
+ import { l as CSSDataArena } from "./arena-BGvFdbj5.js";
2
+ import { X as Value } from "./node-types-YnOKcNfU.js";
3
3
  //#region src/parse-value.d.ts
4
4
  /** @internal */
5
5
  declare class ValueParser {
@@ -1,6 +1,6 @@
1
- import { l as CSSDataArena } from "./arena-DKhfTFT5.js";
2
- import { t as CSSNode } from "./css-node-DKr6cufe.js";
3
- import { t as ValueNodeParser } from "./value-node-parser-JFFFJVX-.js";
1
+ import { l as CSSDataArena } from "./arena-e9O_g2AN.js";
2
+ import { t as CSSNode } from "./css-node-BmD2JJLr.js";
3
+ import { t as ValueNodeParser } from "./value-node-parser-3ET5Z4Rf.js";
4
4
  //#region src/parse-value.ts
5
5
  /** @internal */
6
6
  var ValueParser = class {
package/dist/parse.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { l as CSSDataArena } from "./arena-DcrS77hW.js";
1
+ import { l as CSSDataArena } from "./arena-BGvFdbj5.js";
2
2
  import { t as CommentInfo } from "./tokenize-CDEnYcVG.js";
3
- import { V as StyleSheet } from "./node-types-u3Sbl3_p.js";
3
+ import { H as StyleSheet } from "./node-types-YnOKcNfU.js";
4
4
  //#region src/parse.d.ts
5
5
  interface ParserOptions {
6
6
  parse_values?: boolean;
package/dist/parse.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as Lexer } from "./tokenize-DK24ACbY.js";
2
- import { l as CSSDataArena } from "./arena-DKhfTFT5.js";
3
- import { t as CSSNode } from "./css-node-DKr6cufe.js";
4
- import { a as skip_whitespace_and_comments_backward, s as trim_boundaries, t as SelectorParser } from "./parse-selector-DBdUc04T.js";
2
+ import { l as CSSDataArena } from "./arena-e9O_g2AN.js";
3
+ import { t as CSSNode } from "./css-node-BmD2JJLr.js";
4
+ import { a as skip_whitespace_and_comments_backward, s as trim_boundaries, t as SelectorParser } from "./parse-selector-DMduLN4o.js";
5
5
  import { AtRulePreludeParser } from "./parse-atrule-prelude.js";
6
6
  import { DeclarationParser } from "./parse-declaration.js";
7
7
  //#region src/parse.ts
@@ -1,7 +1,7 @@
1
1
  import { t as Lexer } from "./tokenize-DK24ACbY.js";
2
- import "./arena-DKhfTFT5.js";
2
+ import "./arena-e9O_g2AN.js";
3
3
  import { a as is_whitespace, o as str_equals } from "./parse-dimension-ouWXNHdx.js";
4
- import { i as find_colon_at_depth_zero, o as skip_whitespace_and_comments_forward, s as trim_boundaries, t as SelectorParser } from "./parse-selector-DBdUc04T.js";
4
+ import { i as find_colon_at_depth_zero, o as skip_whitespace_and_comments_forward, s as trim_boundaries, t as SelectorParser } from "./parse-selector-DMduLN4o.js";
5
5
  //#region src/parse-condition.ts
6
6
  /** @internal */
7
7
  var ConditionParser = class {
@@ -486,9 +486,7 @@ var ValueNodeParser = class ValueNodeParser {
486
486
  let branch_start = this.lexer.token_start;
487
487
  let branch_line = this.lexer.token_line;
488
488
  let branch_col = this.lexer.token_column;
489
- let condition_node;
490
- if (tt === 2) condition_node = this.parse_if_condition_function(this.lexer.token_start, this.lexer.token_end);
491
- else condition_node = this.parse_value_node();
489
+ let condition_node = this.parse_if_condition();
492
490
  if (condition_node === null) continue;
493
491
  let condition_end_pos = this.arena.get_start_offset(condition_node) + this.arena.get_length(condition_node);
494
492
  let colon_found = false;
@@ -563,6 +561,83 @@ var ValueNodeParser = class ValueNodeParser {
563
561
  this.arena.append_children(node, branches);
564
562
  return node;
565
563
  }
564
+ is_and_or_not(str) {
565
+ return str_equals("and", str) || str_equals("or", str) || str_equals("not", str);
566
+ }
567
+ next_significant_token() {
568
+ while (this.lexer.pos < this.end) {
569
+ this.lexer.next_token_fast(false);
570
+ if (this.lexer.token_start >= this.end) return 26;
571
+ if (this.is_whitespace_inline()) continue;
572
+ return this.lexer.token_type;
573
+ }
574
+ return 26;
575
+ }
576
+ /**
577
+ * Parse an if()-branch condition:
578
+ * <if-condition> = <boolean-expr[ <if-test> ]> | else
579
+ * <if-test> = style(…) | media(…) | supports(…)
580
+ * i.e. a single test function, the bare "else" identifier, or those test functions
581
+ * combined with not/and/or (e.g. "not style(--x: 1)", "style(--a: 1) and media(width > 600px)").
582
+ * Called with the lexer's current token already positioned at the condition's first token.
583
+ * A simple single-function/"else" condition returns that node directly, unwrapped (matching
584
+ * prior behavior); a compound not/and/or condition wraps the flat operator/function chain in
585
+ * an IF_CONDITION node so IfBranch.condition/.value (single first_child/next_sibling hops)
586
+ * still see exactly one node for "the condition".
587
+ */
588
+ parse_if_condition() {
589
+ if (this.lexer.token_type === 1) {
590
+ let text = this.source.substring(this.lexer.token_start, this.lexer.token_end);
591
+ if (str_equals("else", text)) return this.parse_value_node();
592
+ }
593
+ let first = 0;
594
+ let last = 0;
595
+ let component_count = 0;
596
+ let compound = false;
597
+ for (;;) {
598
+ let tt = this.lexer.token_type;
599
+ let component = null;
600
+ let is_operator = false;
601
+ if (tt === 2) component = this.parse_if_condition_function(this.lexer.token_start, this.lexer.token_end);
602
+ else if (tt === 1) {
603
+ let text = this.source.substring(this.lexer.token_start, this.lexer.token_end);
604
+ if (this.is_and_or_not(text)) {
605
+ is_operator = true;
606
+ component = this.arena.create_node(38, this.lexer.token_start, this.lexer.token_end - this.lexer.token_start, this.lexer.token_line, this.lexer.token_column);
607
+ } else component = this.parse_value_node();
608
+ } else component = this.parse_value_node();
609
+ if (component !== null) {
610
+ component_count++;
611
+ if (first === 0) first = component;
612
+ else this.arena.set_next_sibling(last, component);
613
+ last = component;
614
+ }
615
+ if (tt !== 2 && !is_operator) break;
616
+ let saved = this.lexer.save_position();
617
+ let next_tt = this.next_significant_token();
618
+ if (next_tt === 2) {
619
+ compound = true;
620
+ continue;
621
+ }
622
+ if (next_tt === 1) {
623
+ let text = this.source.substring(this.lexer.token_start, this.lexer.token_end);
624
+ if (this.is_and_or_not(text)) {
625
+ compound = true;
626
+ continue;
627
+ }
628
+ }
629
+ this.lexer.restore_position(saved);
630
+ break;
631
+ }
632
+ if (first === 0) return null;
633
+ if (component_count === 1 && !compound) return first;
634
+ let wrapper_start = this.arena.get_start_offset(first);
635
+ let last_sibling = this.arena.get_last_sibling(first);
636
+ let wrapper_end = this.arena.get_start_offset(last_sibling) + this.arena.get_length(last_sibling);
637
+ let wrapper = this.arena.create_node(60, wrapper_start, wrapper_end - wrapper_start, this.arena.get_start_line(first), this.arena.get_start_column(first));
638
+ this.arena.set_first_child(wrapper, first);
639
+ return wrapper;
640
+ }
566
641
  /**
567
642
  * Parse a condition function inside if() — style(), supports(), or media(). Content parsing
568
643
  * is delegated to the shared ConditionParser (see parse-condition.ts), so these produce the
@@ -597,7 +672,8 @@ var ValueNodeParser = class ValueNodeParser {
597
672
  let child_nodes = [];
598
673
  if (str_equals("style", func_name)) {
599
674
  let decl = this.condition_parser.parse_supports_declaration_content(content_start, content_end);
600
- if (decl !== null) child_nodes = [decl];
675
+ if (decl === null) child_nodes = this.condition_parser.parse_supports_condition(content_start, content_end, func_line, func_col);
676
+ else child_nodes = [decl];
601
677
  } else if (str_equals("supports", func_name)) {
602
678
  let decl = this.condition_parser.parse_supports_declaration_content(content_start, content_end);
603
679
  if (decl === null) child_nodes = this.condition_parser.parse_supports_condition(content_start, content_end, func_line, func_col);
package/dist/walk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as CSSNode, t as AnyNode } from "./node-types-u3Sbl3_p.js";
1
+ import { o as CSSNode, t as AnyNode } from "./node-types-YnOKcNfU.js";
2
2
  //#region src/walk.d.ts
3
3
  declare const SKIP: unique symbol;
4
4
  declare const BREAK: unique symbol;
package/dist/walk.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./arena-DKhfTFT5.js";
2
- import { t as CSSNode } from "./css-node-DKr6cufe.js";
1
+ import "./arena-e9O_g2AN.js";
2
+ import { t as CSSNode } from "./css-node-BmD2JJLr.js";
3
3
  import "./constants.js";
4
4
  //#region src/walk.ts
5
5
  const SKIP = Symbol("SKIP");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectwallace/css-parser",
3
- "version": "0.18.5",
3
+ "version": "0.18.6",
4
4
  "description": "High-performance CSS lexer and parser, optimized for CSS inspection and analysis",
5
5
  "keywords": [
6
6
  "ast",