Home / File/ css-parser.test.ts — tailwindcss Source File

css-parser.test.ts — tailwindcss Source File

Architecture documentation for css-parser.test.ts, a typescript file in the tailwindcss codebase. 2 imports, 0 dependents.

File typescript Oxide 2 imports

Entity Profile

Dependency Diagram

graph LR
  8328e146_5606_fbff_09eb_3b5059f388fa["css-parser.test.ts"]
  8be42ab2_7e92_957a_da93_ffe4c7d161fe["css-parser.ts"]
  8328e146_5606_fbff_09eb_3b5059f388fa --> 8be42ab2_7e92_957a_da93_ffe4c7d161fe
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  8328e146_5606_fbff_09eb_3b5059f388fa --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  style 8328e146_5606_fbff_09eb_3b5059f388fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { describe, expect, it } from 'vitest'
import * as CSS from './css-parser'

const css = String.raw

describe.each(['Unix', 'Windows'])('Line endings: %s', (lineEndings) => {
  function parse(string: string) {
    return CSS.parse(string.replaceAll(/\r?\n/g, lineEndings === 'Windows' ? '\r\n' : '\n'))
  }

  function parseWithLoc(string: string) {
    return CSS.parse(string.replaceAll(/\r?\n/g, lineEndings === 'Windows' ? '\r\n' : '\n'), {
      from: 'input.css',
    })
  }

  describe('comments', () => {
    it('should parse a comment and ignore it', () => {
      expect(
        parse(css`
          /*Hello, world!*/
        `),
      ).toEqual([])
    })

    it('should parse a comment with an escaped ending and ignore it', () => {
      expect(
        parse(css`
          /*Hello, \*\/ world!*/
        `),
      ).toEqual([])
    })

    it('should parse a comment inside of a selector and ignore it', () => {
      expect(
        parse(css`
          .foo {
            /*Example comment*/
          }
        `),
      ).toEqual([
        {
          kind: 'rule',
          selector: '.foo',
          nodes: [],
        },
      ])
    })

    it('should remove comments in between selectors while maintaining the correct whitespace', () => {
      expect(
        parse(css`
          .foo/*.bar*/.baz {
          }
          .foo/*.bar*//*.baz*/.qux
          {
          }
          .foo/*.bar*/ /*.baz*/.qux {
            /*        ^ whitespace */
          }
// ... (1252 more lines)

Domain

Dependencies

Frequently Asked Questions

What does css-parser.test.ts do?
css-parser.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the Oxide domain.
What does css-parser.test.ts depend on?
css-parser.test.ts imports 2 module(s): css-parser.ts, vitest.
Where is css-parser.test.ts in the architecture?
css-parser.test.ts is located at packages/tailwindcss/src/css-parser.test.ts (domain: Oxide, directory: packages/tailwindcss/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free