Home / Function/ applyPrefixesCss() — ui Function Reference

applyPrefixesCss() — ui Function Reference

Architecture documentation for the applyPrefixesCss() function in transform-tw-prefix.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  a6314e93_8f18_2489_1a7d_329f7dc65cd2["applyPrefixesCss()"]
  7edb575e_bbe2_1d90_7009_48ce3cf289ac["transform-tw-prefix.ts"]
  a6314e93_8f18_2489_1a7d_329f7dc65cd2 -->|defined in| 7edb575e_bbe2_1d90_7009_48ce3cf289ac
  14f18958_6010_0c1c_63b2_3aada202d09f["applyPrefix()"]
  a6314e93_8f18_2489_1a7d_329f7dc65cd2 -->|calls| 14f18958_6010_0c1c_63b2_3aada202d09f
  style a6314e93_8f18_2489_1a7d_329f7dc65cd2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/utils/transformers/transform-tw-prefix.ts lines 219–233

export function applyPrefixesCss(
  css: string,
  prefix: string,
  tailwindVersion: TailwindVersion
) {
  const lines = css.split("\n")
  for (let line of lines) {
    if (line.includes("@apply")) {
      const originalTWCls = line.replace("@apply", "").trim()
      const prefixedTwCls = applyPrefix(originalTWCls, prefix, tailwindVersion)
      css = css.replace(originalTWCls, prefixedTwCls)
    }
  }
  return css
}

Subdomains

Frequently Asked Questions

What does applyPrefixesCss() do?
applyPrefixesCss() is a function in the ui codebase, defined in packages/shadcn/src/utils/transformers/transform-tw-prefix.ts.
Where is applyPrefixesCss() defined?
applyPrefixesCss() is defined in packages/shadcn/src/utils/transformers/transform-tw-prefix.ts at line 219.
What does applyPrefixesCss() call?
applyPrefixesCss() calls 1 function(s): applyPrefix.

Analyze Your Own Codebase

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

Try Supermodel Free