Home / Function/ id() — tailwindcss Function Reference

id() — tailwindcss Function Reference

Architecture documentation for the id() function in ast.test.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  3bb38ba0_f892_c45d_c9a2_2e7e5ab5bc1e["id()"]
  e1775747_ac0a_9408_d4ff_3677e8085ed9["ast.test.ts"]
  3bb38ba0_f892_c45d_c9a2_2e7e5ab5bc1e -->|defined in| e1775747_ac0a_9408_d4ff_3677e8085ed9
  style 3bb38ba0_f892_c45d_c9a2_2e7e5ab5bc1e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/ast.test.ts lines 604–622

function id(node: AstNode) {
  switch (node.kind) {
    case 'at-rule':
      return `${node.name} ${node.params}`
    case 'rule':
      return node.selector
    case 'context':
      return '<context>'
    case 'at-root':
      return '<at-root>'
    case 'declaration':
      return `${node.property}: ${node.value}`
    case 'comment':
      return `// ${node.value}`
    default:
      node satisfies never
      throw new Error('Unknown node kind')
  }
}

Domain

Subdomains

Frequently Asked Questions

What does id() do?
id() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/ast.test.ts.
Where is id() defined?
id() is defined in packages/tailwindcss/src/ast.test.ts at line 604.

Analyze Your Own Codebase

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

Try Supermodel Free