Home / Function/ toCss() — tailwindcss Function Reference

toCss() — tailwindcss Function Reference

Architecture documentation for the toCss() function in selector-parser.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  3d8fd16a_e231_9a51_bd56_8f9f2b44612b["toCss()"]
  44cf1398_18e8_9bac_e42c_f3766b1fa98f["selector-parser.ts"]
  3d8fd16a_e231_9a51_bd56_8f9f2b44612b -->|defined in| 44cf1398_18e8_9bac_e42c_f3766b1fa98f
  bc71102c_3f3f_0a7f_c5dc_2ea1f291aec2["replaceNestedClassNameReferences()"]
  bc71102c_3f3f_0a7f_c5dc_2ea1f291aec2 -->|calls| 3d8fd16a_e231_9a51_bd56_8f9f2b44612b
  style 3d8fd16a_e231_9a51_bd56_8f9f2b44612b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/selector-parser.ts lines 70–87

export function toCss(ast: SelectorAstNode[]) {
  let css = ''
  for (const node of ast) {
    switch (node.kind) {
      case 'combinator':
      case 'selector':
      case 'separator':
      case 'value': {
        css += node.value
        break
      }
      case 'function': {
        css += node.value + '(' + toCss(node.nodes) + ')'
      }
    }
  }
  return css
}

Domain

Subdomains

Frequently Asked Questions

What does toCss() do?
toCss() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/selector-parser.ts.
Where is toCss() defined?
toCss() is defined in packages/tailwindcss/src/selector-parser.ts at line 70.
What calls toCss()?
toCss() is called by 1 function(s): replaceNestedClassNameReferences.

Analyze Your Own Codebase

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

Try Supermodel Free