Home / Function/ removeFontVariablesFromCn() — ui Function Reference

removeFontVariablesFromCn() — ui Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

packages/shadcn/src/utils/updaters/update-fonts.ts lines 515–519

function removeFontVariablesFromCn(cnExpr: string) {
  // Remove patterns like "fontName.variable" from cn() call.
  // This is a simple regex-based approach.
  return cnExpr.replace(/,?\s*\w+\.variable/g, "").replace(/cn\(\s*,/, "cn(")
}

Subdomains

Frequently Asked Questions

What does removeFontVariablesFromCn() do?
removeFontVariablesFromCn() is a function in the ui codebase, defined in packages/shadcn/src/utils/updaters/update-fonts.ts.
Where is removeFontVariablesFromCn() defined?
removeFontVariablesFromCn() is defined in packages/shadcn/src/utils/updaters/update-fonts.ts at line 515.
What calls removeFontVariablesFromCn()?
removeFontVariablesFromCn() 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