Home / Function/ toCss() — tailwindcss Function Reference

toCss() — tailwindcss Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  c57928e0_95f9_bd68_c036_1186e1a4d345["toCss()"]
  f0fec366_dab0_6cd4_1266_ed1e249ce89a["substituteFunctionsInValue()"]
  f0fec366_dab0_6cd4_1266_ed1e249ce89a -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  324d33ab_fbf5_0679_98c5_2192fd427d97["substituteFunctionsInValue()"]
  324d33ab_fbf5_0679_98c5_2192fd427d97 -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  e7a34553_0273_6202_4792_07409e33d8f0["toCss()"]
  e7a34553_0273_6202_4792_07409e33d8f0 -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  258ace88_f7c6_412f_9b37_95e1bd249268["printArbitraryValueCache()"]
  258ace88_f7c6_412f_9b37_95e1bd249268 -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  e3afcfef_5f31_4ec2_596b_857a628e6124["simplifyArbitraryVariantCache()"]
  e3afcfef_5f31_4ec2_596b_857a628e6124 -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  3a1a48b0_f593_6ef7_a2a2_e2d97f76468f["constantFoldDeclaration()"]
  3a1a48b0_f593_6ef7_a2a2_e2d97f76468f -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  fcaea65f_8651_c21e_ec5d_f042e1ab495e["decodeArbitraryValue()"]
  fcaea65f_8651_c21e_ec5d_f042e1ab495e -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  ddd2db68_c731_a9de_a974_10945491851d["parseImportParams()"]
  ddd2db68_c731_a9de_a974_10945491851d -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  957946b3_94ca_8f71_30eb_76a6281c51df["theme()"]
  957946b3_94ca_8f71_30eb_76a6281c51df -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  5f56996c_e87d_a997_67df_2ad202639ad3["substituteFunctionsInValue()"]
  5f56996c_e87d_a997_67df_2ad202639ad3 -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  5af2f27c_4323_fb62_14cc_5b4f717b4d2f["createCssUtility()"]
  5af2f27c_4323_fb62_14cc_5b4f717b4d2f -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  15f28ada_869b_555c_8da7_3842f1b432c9["substituteFunctionsInValue()"]
  15f28ada_869b_555c_8da7_3842f1b432c9 -->|calls| c57928e0_95f9_bd68_c036_1186e1a4d345
  style c57928e0_95f9_bd68_c036_1186e1a4d345 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/value-parser.ts lines 41–56

export function toCss(ast: ValueAstNode[]) {
  let css = ''
  for (const node of ast) {
    switch (node.kind) {
      case 'word':
      case 'separator': {
        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.
What calls toCss()?
toCss() is called by 12 function(s): constantFoldDeclaration, createCssUtility, decodeArbitraryValue, parseImportParams, printArbitraryValueCache, simplifyArbitraryVariantCache, substituteFunctionsInValue, substituteFunctionsInValue, and 4 more.

Analyze Your Own Codebase

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

Try Supermodel Free