Home / Function/ insertFontVariablesIntoCn() — ui Function Reference

insertFontVariablesIntoCn() — ui Function Reference

Architecture documentation for the insertFontVariablesIntoCn() function in update-fonts.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  72afa979_2860_4314_2fdd_07eb0b3174a9["insertFontVariablesIntoCn()"]
  b169f1bf_76c5_e7c9_f493_15fe0f296591["update-fonts.ts"]
  72afa979_2860_4314_2fdd_07eb0b3174a9 -->|defined in| b169f1bf_76c5_e7c9_f493_15fe0f296591
  97bdf019_6ec8_1cbd_1fbb_ed4acd2cc973["updateHtmlClassName()"]
  97bdf019_6ec8_1cbd_1fbb_ed4acd2cc973 -->|calls| 72afa979_2860_4314_2fdd_07eb0b3174a9
  style 72afa979_2860_4314_2fdd_07eb0b3174a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/utils/updaters/update-fonts.ts lines 521–525

function insertFontVariablesIntoCn(cnExpr: string, fontVars: string[]) {
  // Insert font variables at the end of cn() arguments.
  const varsStr = fontVars.join(", ")
  return cnExpr.replace(/\)$/, `, ${varsStr})`)
}

Subdomains

Frequently Asked Questions

What does insertFontVariablesIntoCn() do?
insertFontVariablesIntoCn() is a function in the ui codebase, defined in packages/shadcn/src/utils/updaters/update-fonts.ts.
Where is insertFontVariablesIntoCn() defined?
insertFontVariablesIntoCn() is defined in packages/shadcn/src/utils/updaters/update-fonts.ts at line 521.
What calls insertFontVariablesIntoCn()?
insertFontVariablesIntoCn() is called by 1 function(s): updateHtmlClassName.

Analyze Your Own Codebase

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

Try Supermodel Free