diff --git a/src/css-node.ts b/src/css-node.ts index 9c998c8..1b3e698 100644 --- a/src/css-node.ts +++ b/src/css-node.ts @@ -189,7 +189,10 @@ export class CSSNode { this.index = index } - /** Get the arena (for internal/advanced use only) */ + /** + * @internal + * Get the arena (for internal/advanced use only) + */ __get_arena(): CSSDataArena { return this.arena } diff --git a/src/parse-atrule-prelude.test.ts b/src/parse-atrule-prelude.test.ts index e75332a..e25888f 100644 --- a/src/parse-atrule-prelude.test.ts +++ b/src/parse-atrule-prelude.test.ts @@ -518,8 +518,7 @@ describe('At-Rule Prelude Nodes', () => { expect(children.some((c) => c.type === SUPPORTS_QUERY)).toBe(true) const query = children.find((c) => c.type === SUPPORTS_QUERY) - expect(query?.value).toContain('display') - expect(query?.value).toContain('flex') + expect(query?.value).toContain('display: flex') }) it('should trim whitespace and comments from supports queries', () => { @@ -560,7 +559,9 @@ describe('At-Rule Prelude Nodes', () => { const children = atRule?.children.filter((c) => c.type !== BLOCK) || [] expect(children.length).toBe(1) expect(children[0].type).toBe(LAYER_NAME) + expect(children[0].type_name).toBe('Layer') expect(children[0].text).toBe('base') + expect(children[0].value).toBe('base') }) it('should parse comma-separated layer names', () => { @@ -573,12 +574,15 @@ describe('At-Rule Prelude Nodes', () => { expect(children[0].type).toBe(LAYER_NAME) expect(children[0].text).toBe('base') + expect(children[0].value).toBe('base') expect(children[1].type).toBe(LAYER_NAME) expect(children[1].text).toBe('components') + expect(children[1].value).toBe('components') expect(children[2].type).toBe(LAYER_NAME) expect(children[2].text).toBe('utilities') + expect(children[2].value).toBe('utilities') }) }) diff --git a/src/parse-atrule-prelude.ts b/src/parse-atrule-prelude.ts index 51696b8..2440330 100644 --- a/src/parse-atrule-prelude.ts +++ b/src/parse-atrule-prelude.ts @@ -346,6 +346,9 @@ export class AtRulePreludeParser { if (token_type === TOKEN_IDENT) { // Layer name let layer = this.create_node(LAYER_NAME, this.lexer.token_start, this.lexer.token_end) + // Set value to the layer name text (same as the full node text) + this.arena.set_value_start_delta(layer, 0) + this.arena.set_value_length(layer, this.lexer.token_end - this.lexer.token_start) nodes.push(layer) } else if (token_type === TOKEN_COMMA) { // Skip comma separator