Home / Function/ getStyleMap() — ui Function Reference

getStyleMap() — ui Function Reference

Architecture documentation for the getStyleMap() function in rehype.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  f69c1662_c2d3_9289_3290_fd94b6192fd1["getStyleMap()"]
  e2427336_4794_0f1c_982a_f2089ffcec85["rehype.ts"]
  f69c1662_c2d3_9289_3290_fd94b6192fd1 -->|defined in| e2427336_4794_0f1c_982a_f2089ffcec85
  57fb1ae2_1d20_217c_ddee_7f949e8a5347["formatCode()"]
  57fb1ae2_1d20_217c_ddee_7f949e8a5347 -->|calls| f69c1662_c2d3_9289_3290_fd94b6192fd1
  e3c0c0bd_fd5f_8448_49f9_30a33cc96f34["getStyleFromStyleName()"]
  f69c1662_c2d3_9289_3290_fd94b6192fd1 -->|calls| e3c0c0bd_fd5f_8448_49f9_30a33cc96f34
  style f69c1662_c2d3_9289_3290_fd94b6192fd1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/lib/rehype.ts lines 88–107

async function getStyleMap(styleName: string) {
  const style = getStyleFromStyleName(styleName)

  if (styleMapCache.has(style)) {
    return styleMapCache.get(style)!
  }

  try {
    const cssPath = path.join(
      process.cwd(),
      `registry/styles/style-${style}.css`
    )
    const css = await fsPromises.readFile(cssPath, "utf-8")
    const styleMap = createStyleMap(css)
    styleMapCache.set(style, styleMap)
    return styleMap
  } catch {
    return {}
  }
}

Subdomains

Called By

Frequently Asked Questions

What does getStyleMap() do?
getStyleMap() is a function in the ui codebase, defined in apps/v4/lib/rehype.ts.
Where is getStyleMap() defined?
getStyleMap() is defined in apps/v4/lib/rehype.ts at line 88.
What does getStyleMap() call?
getStyleMap() calls 1 function(s): getStyleFromStyleName.
What calls getStyleMap()?
getStyleMap() is called by 1 function(s): formatCode.

Analyze Your Own Codebase

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

Try Supermodel Free